A096376 a(n) = n + (n-1)^2 + (n+1)^2.
2, 5, 12, 23, 38, 57, 80, 107, 138, 173, 212, 255, 302, 353, 408, 467, 530, 597, 668, 743, 822, 905, 992, 1083, 1178, 1277, 1380, 1487, 1598, 1713, 1832, 1955, 2082, 2213, 2348, 2487, 2630, 2777, 2928, 3083, 3242, 3405, 3572, 3743, 3918, 4097, 4280, 4467, 4658
Offset: 0
Examples
1 + 0 + 4 = 5, 2 + 1 + 9 = 12, 3 + 4 + 16 = 23, ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..5000
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Programs
-
Maple
A096376:=n->n + (n-1)^2 + (n+1)^2: seq(A096376(n), n=0..100); # Wesley Ivan Hurt, Jul 16 2017
-
Mathematica
f[n_]:=(n*(2*n+1)+2);Table[f[n],{n,5!}] (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *) LinearRecurrence[{3,-3,1},{2,5,12},50] (* Harvey P. Dale, Mar 15 2015 *)
-
PARI
a(n)=n+(n-1)^2+(n+1)^2 \\ Charles R Greathouse IV, Oct 07 2015
Formula
a(n) = 2*n^2 + n + 2. - N. J. A. Sloane, Nov 10 2009
a(n) = 4*n + a(n-1) - 1 (with a(0)=2). - Vincenzo Librandi, Nov 16 2010
From Colin Barker, Oct 03 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: (2 - x + 3*x^2)/(1-x)^3. (End)
E.g.f.: (2*x^2 + 3*x +2)*exp(x). - G. C. Greubel, Jul 16 2017
Comments