login
A181586
a(0)=0; a(n+1) = 2*a(n) + period 4:repeat 0,1,-2,1.
1
0, 0, 1, 0, 1, 2, 5, 8, 17, 34, 69, 136, 273, 546, 1093, 2184, 4369, 8738, 17477, 34952, 69905, 139810, 279621, 559240, 1118481, 2236962, 4473925, 8947848, 17895697, 35791394, 71582789, 143165576, 286331153, 572662306, 1145324613, 2290649224
OFFSET
0,6
COMMENTS
a(n) + a(n+1) + a(n+2) + a(n+3) = 2^n.
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
Cf. A180343.
Sequence in context: A162216 A032158 A103745 * A112361 A343129 A050872
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jan 30 2011
STATUS
approved