OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-5,2).
FORMULA
For n >= 6, a(n) = 2^(n+2) - 2*(n+1).
G.f.: x*(2 + x^2 - 3*x^3 + 2*x^4 + x^5 - 3*x^6 + 2*x^7)/((1-x)^2*(1-2*x)). - Colin Barker, Dec 02 2012
MATHEMATICA
LinearRecurrence[{4, -5, 2}, {2, 8, 23, 53, 115, 242, 496, 1006}, 30] (* Harvey P. Dale, Dec 15 2015 *)
PROG
(PARI) my(x='x+O('x^30)); Vec(x*(2+x^2-3*x^3+2*x^4+x^5-3*x^6+2*x^7 )/((1-x)^2*(1-2*x))) \\ G. C. Greubel, Jan 18 2019
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(2+x^2-3*x^3+2*x^4+x^5-3*x^6+2*x^7 )/((1-x)^2*(1-2*x)) )); // G. C. Greubel, Jan 18 2019
(Sage) a=(x*(2+x^2-3*x^3+2*x^4+x^5-3*x^6+2*x^7 )/((1-x)^2*(1-2*x)) ).series(x, 30).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jan 18 2019
(GAP) a:=[242, 496, 1006];; for n in [4..30] do a[n]:=4*a[n-1]-5*a[n-2] +2*a[n-3]; od; Concatenation([2, 8, 23, 53, 115], a); # G. C. Greubel, Jan 18 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Jan 12 2003
STATUS
approved