OFFSET
0,2
REFERENCES
Graham Everest, Alf van der Poorten, Igor Shparlinski, and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
Paul R. Halmos, Problems for Mathematicians Young and Old. Math. Assoc. America, 1991, p. 179.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (5,-9,7,-2).
FORMULA
From R. J. Mathar, Nov 16 2007: (Start)
G.f.: (2*x-2*x^2+3*x^3-1)/(1-x)^3/(-1+2*x).
From Elmo R. Oliveira, Dec 25 2025: (Start)
E.g.f.: exp(x)*(x*(1 + x) + exp(x)).
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4). (End)
MATHEMATICA
f[n_]:=n^2+2^n; Table[f[n], {n, 0, 5!}] (* Vladimir Joseph Stephan Orlovsky, Dec 05 2009 *)
LinearRecurrence[{5, -9, 7, -2}, {1, 3, 8, 17}, 30] (* Harvey P. Dale, Jan 05 2020 *)
PROG
(Magma) [2^n+n^2: n in [0..35]]; // Vincenzo Librandi, Jun 07 2011
(PARI) a(n)=2^n+n^2 \\ Charles R Greathouse IV, Apr 17 2012
(Python)
def A001580(n): return (1<<n)+n**2 # Chai Wah Wu, Apr 23 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved
