OFFSET
0,2
COMMENTS
Only from the 13th term on, this differs from the limit sequence of { 1 -> 131, 2 -> 212, 3 -> 323 } = absolute values of A229215. - M. F. Hasler, Aug 06 2015
LINKS
J. M. Dumont and A. Thomas, Digital sum problems and substitutions on a finite alphabet, J. Number Theory, 39 (1991), 351-366.
MAPLE
S:={1=[1, 3], 2=[1, 3, 2, 2, 3], 3=[1, 3, 2, 3]}:subs(S, 1):subs(S, %):subs(S, %):subs(S, %):subs(S, %); # all brackets have to be removed. - Emeric Deutsch, simplified by M. F. Hasler, Aug 06 2015
S:={1=(1, 3), 2=(1, 3, 2, 2, 3), 3=(1, 3, 2, 3)}: (curry(subs, S)@@6)([1]); # Robert Israel, Aug 06 2015
MATHEMATICA
Nest[ Flatten[ # /. {1 -> {1, 3}, 2 -> {1, 3, 2, 2, 3}, 3 -> {1, 3, 2, 3}}] &, {1}, 5] (* Robert G. Wilson v, Jun 20 2005 *)
PROG
(PARI) A106824(n, a=[1], S=[[1, 3], [1, 3, 2, 2, 3], [1, 3, 2, 3]])={while(#a<n, a=concat(apply(i->S[i], a))); a} \\ M. F. Hasler, Aug 06 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 20 2005
EXTENSIONS
More terms from Emeric Deutsch, May 30 2005
STATUS
approved