OFFSET
0,6
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,1,2).
FORMULA
a(n) = a(n-4) + 2^(n-4).
a(n) = -a(n-2) + A078008(n).
a(n) = a(n-2) + A118405(n-2) unsigned.
a(n) = a(n-1) + a(n-2) + a(n-3) + 2*a(n-4) (**).
G.f. x^2*(-1+x) / ( (2*x-1)*(1+x)*(x^2+1) ). - R. J. Mathar, Feb 06 2011
EXAMPLE
a(1)=2*a(0)+0=0, a(2)=2*a(1)+1=0+1=1, a(3)=2*a(2)-2=2-2=0, a(4)=2*a(3)+1=0+1=1, a(5)=2*a(4)+0=2+0=2, a(6)=2*a(5)+1=4+1=5.
MAPLE
a:= proc(n) option remember;
`if`(n=0, 0, 2*a(n-1) +[0, 1, -2, 1][irem(n-1, 4)+1])
end:
seq(a(n), n=0..40); # Alois P. Heinz, Jan 30 2011
MATHEMATICA
LinearRecurrence[{1, 1, 1, 2}, {0, 0, 1, 0}, 40] (* Jean-François Alcover, May 18 2018 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jan 30 2011
STATUS
approved