login
a(n) = 2^n + n^2.
28

%I #32 Apr 23 2023 12:23:28

%S 1,3,8,17,32,57,100,177,320,593,1124,2169,4240,8361,16580,32993,65792,

%T 131361,262468,524649,1048976,2097593,4194788,8389137,16777792,

%U 33555057,67109540,134218457,268436240

%N a(n) = 2^n + n^2.

%D G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.

%D P. R. Halmos, Problems for Mathematicians Young and Old. Math. Assoc. America, 1991, p. 179.

%H Vincenzo Librandi, <a href="/A001580/b001580.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (5,-9,7,-2).

%F G.f.: (2*x-2*x^2+3*x^3-1)/(1-x)^3/(-1+2*x). a(n) = 2*A000217(n+1)+A000079(n) -3*A000027(n+1)+1. - _R. J. Mathar_, Nov 16 2007

%t f[n_]:=n^2+2^n; Table[f[n],{n,0,5!}] (* _Vladimir Joseph Stephan Orlovsky_, Dec 05 2009 *)

%t LinearRecurrence[{5,-9,7,-2},{1,3,8,17},30] (* _Harvey P. Dale_, Jan 05 2020 *)

%o (Magma) [2^n+n^2: n in [0..35]]; // _Vincenzo Librandi_, Jun 07 2011

%o (PARI) a(n)=2^n+n^2 \\ _Charles R Greathouse IV_, Apr 17 2012

%o (Maxima) A001580(n):=2^n+n^2$ makelist(A001580(n),n,0,20); /* _Martin Ettl_, Dec 18 2012 */

%o (Python)

%o def A001580(n): return (1<<n)+n**2 # _Chai Wah Wu_, Apr 23 2023

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_