OFFSET
1,1
REFERENCES
R. P. Grimaldi, Ternary strings with no consecutive 0's and no consecutive 1's, Congressus Numerantium, 205 (2011), 129-149. See p. 142.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,1).
FORMULA
a(n) = 2*a(n-2)+a(n-4). G.f.: -x*(3+x+x^2+x^3) / ( -1+2*x^2+x^4 ). - Colin Barker, Jul 24 2013
a(n) = a(n-1)+2*a(n-2) if n odd. a(n) =(a(n-1)-a(n-2))/2 if n even. - R. J. Mathar, Jun 18 2014
MAPLE
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, If[EvenQ[n], b+2a, (b-a)/2]}; NestList[nxt, {2, 3, 1}, 50][[All, 2]] (* or *) LinearRecurrence[{0, 2, 0, 1}, {3, 1, 7, 3}, 50] (* Harvey P. Dale, Mar 06 2019 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Apr 16 2011
STATUS
approved