OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (6,-12,10,-3).
FORMULA
MAPLE
MATHEMATICA
Table[3^n + n^2, {n, 0, 40}] (* or *) CoefficientList[Series[(1 - 2 x + x^2 - 4 x^3) / ((1 - 3 x) (1 - x)^3), {x, 0, 40}], x]
LinearRecurrence[{6, -12, 10, -3}, {1, 4, 13, 36}, 30] (* Harvey P. Dale, Aug 08 2017 *)
PROG
(Magma) [3^n+n^2: n in [0..30]] /* or */ I:=[1, 4, 13, 36]; [n le 4 select I[n] else 6*Self(n-1)-12*Self(n-2)+10*Self(n-3)-3*Self(n-4): n in [1..30]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Dec 07 2014
STATUS
approved