login
Number of different ways to form n by concatenation, using the digits of the numbers from 0 to n-1.
1

%I #30 Jul 18 2026 16:45:29

%S 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,

%T 24,9,52,65,30,24,27,30,33,36,39,16,70,84,98,56,40,44,48,52,56,25,90,

%U 105,120,135,90,60,65,70,75,36,112,128,144,160,176,132,84,90

%N Number of different ways to form n by concatenation, using the digits of the numbers from 0 to n-1.

%H Robert G. Wilson v, <a href="/A397690/b397690.txt">Table of n, a(n) for n = 0..10000</a> (First 1001 terms from Paolo P. Lava)

%e From a(0) to a(9) there are no available preceding digits to form n;

%e a(10) = 1 because we can pick up 1 and 0 and there is just this possibility to form 10;

%e 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.

%p P:=proc(q) local a,b,c,j,k,n,t,v; v:=[0,0,0,0,0,0,0,0,0,0];

%p t:=array(1..10); for k from 1 to 10 do t[k]:=1; od;

%p for n from 10 to q do a:=convert(n,base,10); b:=1; for k in {op(a)} do c:=numboccur(k,a);

%p 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];

%p od; op(v); end: P(100);

%t 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 *)

%K nonn,base,easy,new

%O 0,12

%A _Paolo P. Lava_, Jul 05 2026