A329360 The decimal expansion of a(n) is the first n terms of A000002.
0, 1, 12, 122, 1221, 12211, 122112, 1221121, 12211212, 122112122, 1221121221, 12211212212, 122112122122, 1221121221221, 12211212212211, 122112122122112, 1221121221221121, 12211212212211211, 122112122122112112, 1221121221221121122, 12211212212211211221
Offset: 0
Crossrefs
Programs
-
Mathematica
kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]] kol[n_Integer]:=If[n==0,{},Nest[kolagrow,{1},n-1]]; Table[FromDigits[kol[n]],{n,0,30}]