A008352 a(n) is formed by concatenating a(n-2) and a(n-1), with a(0) = 1, a(1) = 2.
1, 2, 12, 212, 12212, 21212212, 1221221212212, 212122121221221212212, 1221221212212212122121221221212212, 2121221212212212122121221221212212212122121221221212212
Offset: 0
References
- D. E. Knuth, "The Art of Programming", Volume 1, "Fundamental Algorithms", third edition, problem 36 on page 86.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..15
- Jean Berstel, Fibonacci words—a survey, In The book of L, pp. 13-27. Springer Berlin Heidelberg, 1986.
- S. Brlek, E. Duchi, E. Pergola and S. Rinaldi, On the equivalence problem for succession rules, Discr. Math., 298 (2005), 142-154.
- C. Delorme, Sequence of maximal distance codes in graphs or other metric spaces, Electronic Journal of Graph Theory and Applications 1 (2) (2013), 118-124.
- K. B. Stolarsky, Beatty sequences, continued fractions, and certain shift operators, Canadian Math. Bull. 19 (1976) pp. 473-482.
- A. Vieru, Lindenmayer systems and primes, arXiv:math.NT/0803.0852 [math.NT], 2008.
- Wikipedia, Lindenmayer system
Programs
-
Maple
f:=proc(n) option remember; if n = 0 then return(`1`); fi; if n = 1 then return(`2`); fi; cat(f(n-2), f(n-1) ); end;
-
Mathematica
nxt[{a_,b_}]:={b,FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]]}; NestList[ nxt,{1,2},10][[All,1]] (* Harvey P. Dale, Jul 16 2017 *)
Formula
With offset set to 1, a(1)=1 and a(2)=2, then a(n) = a(n-1)+10^A000045(n)*a(n-2). - Benoit Cloitre, Nov 24 2001
a(n) = beta^n(1), where beta is the morphism 1->2, 2->12. - Michel Dekking, Sep 30 2019
Comments