OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = (n+2)*(n^2 + (n+1)^2).
G.f.: x*(3-x)*(5-x+2*x^2)/(1-x)^4. [Colin Barker, Mar 28 2012]
MATHEMATICA
Table[2*(n + 1)^3 - n, {n, 38}] (* L. Edson Jeffery, Jan 11 2018 *)
LinearRecurrence[{4, -6, 4, -1}, {15, 52, 125, 246}, 40] (* Harvey P. Dale, May 01 2022 *)
PROG
(C)
int a(int n)
{
return ((n+2)*((n*n)*((n+1)*(n+1))));
}
(PARI) a(n)=2*n^3+6*n^2+5*n+2 \\ Charles R Greathouse IV, Jul 31 2011
(Magma) [(n+2)*(n^2 + (n+1)^2): n in [1..40] ]; // Vincenzo Librandi, Aug 01 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ankur Trapasiya, Jul 31 2011
STATUS
approved