OFFSET
0,2
COMMENTS
Also length of successive strings generated by an alternating Kolakoski (2,4) rule starting at 4 (i.e. string begins with 2 if previous string ends with 4 and vice et versa) : 4-->2222-->44224422-->444422224422444422224422-->... and length of strings are 1,4,8,24,72,... - Benoit Cloitre, Oct 15 2005
Also number of words of length n over alphabet {1,2,3} with no fixed points (a fixed point is value i in position i). - Margaret Archibald, Jun 23 2020
REFERENCES
M. Archibald, A. Blecher and A. Knopfmacher, Fixed points in compositions and words, accepted by the Journal of Integer Sequences.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
M. Archibald, A. Blecher, and A. Knopfmacher, Fixed Points in Compositions and Words, J. Int. Seq., Vol. 23 (2020), Article 20.11.1.
Index entries for linear recurrences with constant coefficients, signature (3).
FORMULA
a(n) = 3*a(n-1) for n>3. G.f.: (4*x^3+2*x^2+x-1) / (3*x-1). - Colin Barker, Jun 15 2013
a(n) = floor( (4*n-2)/(n+1) )*a(n-1). Without the floor function the recursion gives the Catalan numbers (A000108). - Hauke Woerpel, Oct 16 2020
MATHEMATICA
CoefficientList[Series[(4 x^3 + 2 x^2 + x - 1)/(3 x - 1), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 18 2013 *)
Join[{1, 2, 4}, NestList[3#&, 8, 30]] (* Harvey P. Dale, May 14 2022 *)
PROG
(PARI) a(n)=if(n>3, 8/27*3^n, 2^n) \\ Charles R Greathouse IV, Jun 23 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved