login
A103684
Triangle read by rows, based on the morphism f: 1->{1,2}, 2->{1,3}, 3->{1}. First row is 1. If current row is a,b,c,..., then the next row is a,b,c,...,f(a),f(b),f(c),...
15
1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1
OFFSET
1,4
EXAMPLE
[1], [1,1,2], [1,1,2,1,2,1,2,1,3], [1,1,2,1,2,1,2,1,3,1,2,1,2,1,3,1,2,1,3,1,2,1,3,1,2,1], ...
MATHEMATICA
NestList[ Flatten[ Join[ #, # /. {1 -> {1, 2}, 2 -> {1, 3}, 3->{1}}]] &, {1}, 4] // Flatten (* Robert G. Wilson v, Jul 09 2006 - corrected by G. C. Greubel, Oct 26 2017 *)
PROG
(PARI) {a(n)=local(m, v, w); v=w=[1]; while(length(w)<n, m=length(v); for(k=1, m, v=concat(v, [[1, 2], [1, 3], [1]][v[k]])); w=concat(w, v)); w[n]} /* Michael Somos, Apr 16 2005 */
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Roger L. Bagula, Mar 26 2005
EXTENSIONS
Image of {3} in the definition corrected by R. J. Mathar, Nov 18 2010
STATUS
approved