OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
A. J. Macfarlane, Generating functions for integer sequences defined by the evolution of cellular automata with even rule numbers, 2016. See Fig. 13.
Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
FORMULA
From Colin Barker, Mar 16 2017: (Start)
G.f.: (1 + 2*x - 2*x^3) / ((1 - x)*(1 - 2*x)*(1 + 2*x)).
a(n) = (-4 + (-2)^n + 21*2^n) / 12 for n>0.
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n>3.
(End)
MAPLE
f:=proc(n) option remember;
if n=0 then 1 elif n=1 then 3 elif n=2 then 7
else 4*f(n-2)+1; fi; end;
[seq(f(n), n=0..40)];
MATHEMATICA
LinearRecurrence[{1, 4, -4}, {1, 3, 7, 13}, 36] (* or *) CoefficientList[Series[(1 + 2*x - 2*x^3) / ((1 - x)*(1 - 2*x)*(1 + 2*x)) , {x, 0, 35}], x] (* Indranil Ghosh, Mar 16 2017 *)
PROG
(PARI) Vec((1 + 2*x - 2*x^3) / ((1 - x)*(1 - 2*x)*(1 + 2*x)) + O(x^40)) \\ Colin Barker, Mar 16 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Mar 16 2017
STATUS
approved
