OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-12,10,-3).
FORMULA
G.f.: (1-4*x+5*x^2+2*x^3)/((1-3*x)*(1-x)^3). - Vincenzo Librandi, Oct 05 2014
a(n) = 6*a(n-1) -12*a(n-2) +10*a(n-3) -3*a(n-4) for n>3. - Vincenzo Librandi, Oct 05 2014
E.g.f.: exp(3*x) - x*(1+x)*exp(x). - G. C. Greubel, Aug 18 2023
MAPLE
MATHEMATICA
Table[3^n - n^2, {n, 0, 25}] (* or *) CoefficientList[Series[(1 - 4 x + 5 x^2 + 2 x^3)/((1 - 3 x) (1 - x)^3), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 05 2014 *)
PROG
(Magma) [3^n-n^2: n in [0..30]]; // Vincenzo Librandi, Jul 02 2011
(SageMath) [3^n-n^2 for n in range(31)] # G. C. Greubel, Aug 18 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved