A275788 a(0) = 0, a(n+1) = 2*a(n) + (-1)^floor(n/3).
0, 1, 3, 7, 13, 25, 49, 99, 199, 399, 797, 1593, 3185, 6371, 12743, 25487, 50973, 101945, 203889, 407779, 815559, 1631119, 3262237, 6524473, 13048945, 26097891, 52195783, 104391567, 208783133, 417566265, 835132529, 1670265059, 3340530119, 6681060239
Offset: 0
Keywords
Examples
a(1)=2*0+1=1, a(2)=2*1+1=3, a(2)=2*3+1=7, a(3)=2*7-1=13, a(4)=2*13-1=25, ... .
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,0,-1,2).
Crossrefs
Programs
-
Mathematica
CoefficientList[Series[x (1 + x + x^2)/((1 + x) (1 - 2 x) (1 - x + x^2)), {x, 0, 33}], x] (* Michael De Vlieger, Aug 11 2016 *) LinearRecurrence[{2,0,-1,2}, {0, 1, 3, 7}, 25] (* G. C. Greubel, Aug 16 2016 *)
-
PARI
concat(0, Vec(x*(1+x+x^2)/((1+x)*(1-2*x)*(1-x+x^2)) + O(x^40))) \\ Colin Barker, Aug 10 2016
Formula
From Colin Barker, Aug 09 2016: (Start)
a(n) = 2*a(n-1) - a(n-3) + 2*a(n-4) for n>3.
G.f.: x*(1 + x + x^2) / ((1+x)*(1-2*x)*(1-x+x^2)).
(End)
a(n+3) = 7*2^n - a(n), a(0)=0, a(1)=1, a(2)=3.
Extensions
More terms from Colin Barker, Aug 10 2016
Comments