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”).

a(n) = A123895(n^2).
4

%I #14 Dec 16 2015 00:07:12

%S 0,1,1,1,12,12,12,12,12,12,100,121,122,123,123,112,123,123,123,123,

%T 100,112,121,123,123,123,121,123,123,123,100,123,1023,1023,1123,1223,

%U 1234,1234,1222,1231,1200,1231,1234,1234,1234,1012,1223,1102,1203,1203,1200

%N a(n) = A123895(n^2).

%D D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5, p. 432, Problems 4 and 5.

%H Michael De Vlieger, <a href="/A123896/b123896.txt">Table of n, a(n) for n = 0..10000</a>

%t f[n_] := Block[{d = Prepend[IntegerDigits@ n, 0], a, b, w}, b = DeleteDuplicates@ d; a = Range[0, Length@ b]; w = FromDigits@ Flatten[Part[a, FirstPosition[b, #]] & /@ d]; w]; Table[f[n^2], {n, 0, 50}] (* _Michael De Vlieger_, Dec 09 2015, Version 10 *)

%K nonn,base

%O 0,5

%A _N. J. A. Sloane_, Nov 20 2006

%E More terms from _Franklin T. Adams-Watters_, Nov 20 2006