A218556 Numbers with d distinct decimal digits (d=1,...,10) such that for each k=1,...,d, some digit occurs exactly k times.
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
Examples
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.
Programs
-
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 }
Comments