A276477 a(n) = a(n-2) + a(n-3) for n >= 3, with a(0) = a(1) = 2, a(2) = 1.
2, 2, 1, 4, 3, 5, 7, 8, 12, 15, 20, 27, 35, 47, 62, 82, 109, 144, 191, 253, 335, 444, 588, 779, 1032, 1367, 1811, 2399, 3178, 4210, 5577, 7388, 9787, 12965, 17175, 22752, 30140, 39927, 52892, 70067, 92819, 122959, 162886, 215778, 285845, 378664, 501623, 664509
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 1, 1).
Programs
-
Magma
I:=[2,2,1]; [n le 3 select I[n] else Self(n-2)+Self(n-3): n in [1..50]]; // Vincenzo Librandi, Sep 10 2016
-
Mathematica
RecurrenceTable[{a[n] == a[n - 2] + a[n - 3], a[1] == a[2] == 2, a[3] == 1}, a, {n, 42}] CoefficientList[Series[(x^2 - 2 x - 2)/(x^3 + x^2 - 1), {x, 0, 41}], x] (* Michael De Vlieger, Sep 06 2016 *) LinearRecurrence[{0, 1, 1}, {2, 2, 1}, 60] (* Vincenzo Librandi, Sep 10 2016 *)
-
PARI
x='x+O('x^99); Vec((x^2-2*x-2)/(x^3+x^2-1)) \\ Altug Alkan, Sep 10 2016
Comments