A286311 a(n) = 2*a(n-1) - a(n-2) + a(n-4), n>3, a(0)=0, a(1)=a(2)=1, a(3)=3.
0, 1, 1, 3, 5, 8, 12, 19, 31, 51, 83, 134, 216, 349, 565, 915, 1481, 2396, 3876, 6271, 10147, 16419, 26567, 42986, 69552, 112537, 182089, 294627, 476717, 771344, 1248060, 2019403, 3267463, 5286867, 8554331, 13841198, 22395528, 36236725, 58632253, 94868979
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- OEIS Wiki, Autosequence
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1).
Programs
-
Magma
I:=[0,1,1,3]; [n le 4 select I[n] else 2*Self(n-1) - Self(n-2) + Self(n-4): n in [1..30]]; // G. C. Greubel, Jan 15 2018
-
Mathematica
LinearRecurrence[{2, -1, 0, 1}, {0, 1, 1, 3}, 40] (* or *) CoefficientList[Series[x (1 - x + 2 x^2)/((1 - x + x^2) (1 - x - x^2)), {x, 0, 39}], x] (* Michael De Vlieger, May 07 2017 *)
-
PARI
concat(0, Vec(x*(1 - x + 2*x^2) / ((1 - x + x^2)*(1 - x - x^2)) + O(x^60))) \\ Colin Barker, May 06 2017
Formula
a(n) = 2*a(n-1) - a(n-2) + a(n-4). Valid for b(n).
G.f.: x*(1 - x + 2*x^2) / ((1 - x + x^2)*(1 - x - x^2)). - Colin Barker, May 06 2017
Extensions
More terms from Colin Barker, May 06 2017
Comments