A082204 Begin with a 1, then place the smallest (as far as possible distinct) digits, such that, beginning from the n-th term, n terms form a palindrome.
1, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2
Offset: 0
Examples
The first six palindromes are 1, 22, 232, 3223, 22322, 232232.
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 1).
Programs
-
Mathematica
Join[{1},LinearRecurrence[{0, 0, 1},{2, 2, 3},104]] (* Ray Chandler, Aug 25 2015 *)
Formula
a(1) = 1; for k > 0, a(3k-1) = a(3k) = 2; a(3k+1) = 3. - David Wasserman, Aug 19 2004
Extensions
More terms from David Wasserman, Aug 19 2004