login
A397690
Number of different ways to form n by concatenation, using the digits of the numbers from 0 to n-1.
1
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 4, 36, 12, 12, 14, 16, 18, 20, 22, 24, 9, 52, 65, 30, 24, 27, 30, 33, 36, 39, 16, 70, 84, 98, 56, 40, 44, 48, 52, 56, 25, 90, 105, 120, 135, 90, 60, 65, 70, 75, 36, 112, 128, 144, 160, 176, 132, 84, 90
OFFSET
0,12
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..10000 (First 1001 terms from Paolo P. Lava)
EXAMPLE
From a(0) to a(9) there are no available preceding digits to form n;
a(10) = 1 because we can pick up 1 and 0 and there is just this possibility to form 10;
a(11) = 2 because we can pick up 1 and another 1 from number 10 and we can do this in two different ways; etc.
MAPLE
P:=proc(q) local a, b, c, j, k, n, t, v; v:=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
t:=array(1..10); for k from 1 to 10 do t[k]:=1; od;
for n from 10 to q do a:=convert(n, base, 10); b:=1; for k in {op(a)} do c:=numboccur(k, a);
for j from 0 to c-1 do b:=b*(t[k+1]-j); od; t[k+1]:=t[k+1]+c; od; v:=[op(v), b];
od; op(v); end: P(100);
MATHEMATICA
a[n_] := Block[{c = Count[ Sort[ Flatten[ IntegerDigits[ Range[0, n -1]]]], #] & /@ Range[0, 9], d = Count[ Sort[ IntegerDigits[n]], #] & /@ Range[0, 9]}, Product[ d[[j]]!*Binomial[c[[j]], d[[j]]], {j, 10}]]; Array[a, 69, 0] (* Robert G. Wilson v, Jul 17 2026 *)
CROSSREFS
Sequence in context: A195994 A182815 A196252 * A004722 A094798 A326178
KEYWORD
nonn,base,easy,new
AUTHOR
Paolo P. Lava, Jul 05 2026
STATUS
approved