A130844 a(n) = 2*a(n-1) + a(n-2) - a(n-3) + a(n-4), with a(1) = 0, a(2) = 3, a(3) = 5 and a(4) = 17.
0, 3, 5, 17, 36, 87, 198, 464, 1075, 2503, 5815, 13522, 31431, 73072, 169868, 394899, 918025, 2134153, 4961300, 11533627, 26812426, 62331332, 144902763, 336858059, 783099975, 1820486578, 4232117835, 9838480332, 22871691896, 53170232867
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (2,1,-1,1).
Programs
-
Magma
I:=[0,3,5,17]; [n le 4 select I[n] else 2*Self(n-1) +Self(n-2) -Self(n-3) + Self(n-4): n in [1..30]]; // G. C. Greubel, Nov 03 2018
-
Mathematica
LinearRecurrence[{2,1,-1,1},{0,3,5,17},30] (* Harvey P. Dale, Dec 20 2014 *)
-
PARI
m=30; v=concat([0,3,5,17], vector(m-4)); for(n=5, m, v[n] = 2*v[n-1] +v[n-2] -v[n-3] +v[n-4]); v \\ G. C. Greubel, Nov 03 2018
Formula
G.f.: x^2*(3 - x + 4*x^2)/((1 + x)*(1 - 3*x + 2*x^2 - x^3)). - Colin Barker, Nov 02 2012
Extensions
New name (after Colin Barker) by Franck Maminirina Ramaharo, Nov 02 2018
Edited by N. J. A. Sloane, Nov 03 2018