login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A218556
Numbers with d distinct decimal digits (d=1,...,10) such that for each k=1,...,d, some digit occurs exactly k times.
5
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 101, 110, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166, 171, 177, 181, 188, 191, 199, 200, 202, 211, 212, 220, 221, 223, 224, 225, 226, 227, 228, 229, 232, 233, 242, 244, 252, 255, 262, 266, 272, 277, 282, 288, 292, 299, 300, 303, 311, 313, 322, 323, 330
OFFSET
1,3
COMMENTS
For each of the terms, the number of digits is a triangular number A000217.
The number of terms with d = 1,2,3,... different digits is 10, 243, 38880, ... = A218566(10,d) (+ 1 for d=1, accounting for the initial 0).
The sequence is finite, it has N = 1 + sum_{i=1..10} A218566(10,i) = 9083370609101493843078695864582213215764827510991133 terms. The last term is a(N) = 9999999999888888888777777776666666555555444443333222110 (ten "9"s, nine "8"s, ..., one "0").
EXAMPLE
The terms a(1)=0 through a(10)=9 have exactly 1 digit occurring exactly once.
The terms a(11)=100 through a(253)=998, listed in A210666, have one digit occurring once and a second, different digit occurring exactly twice.
The terms a(254)=100012 through a(39133)=999887 are listed in A182040.
For d=4, we have the (1+2+3+4 =) 10-digit terms a(39134)=1000011223 through 9999888776 with 4 different digits which occur with frequencies 1,2,3 and 4.
PROG
(PARI) {my(T(n)=n*(n+1)\2); print1(0); for(i=1, 2, s=vector(i+1, j, j-1); for(n=10^(T(i)-1), 10^T(i)-1, i !=#Set(digits(n)) & next; c=vector(10); for(j=1, #d=digits(n), c[d[j]+1]++); vecsort(c, , 8)==s & print1(", "n)))}
(PARI) is_A218556(n)={ my(c=vector(10)); for(i=1, #n=digits(n), c[n[i]+1]++); #(c=vecsort(c, , 8))==1+c[#c] && 2*#n==c[#c]*#c }
CROSSREFS
KEYWORD
nonn,easy,base,fini
AUTHOR
M. F. Hasler, Nov 02 2012
STATUS
approved