OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = (1/2)*(3*n^2 + 17*n - 38), for n > 3. - Ralf Stephan
From G. C. Greubel, Jan 01 2024: (Start)
G.f.: x^2*(2 + 13*x - 12*x^2 + x^3 - x^4)/(1-x)^3.
E.g.f.: (1/2)*(-38 + 20*x + 3*x^2)*exp(x) + 19 + 9*x - x^2 - x^3/3!. (End)
MATHEMATICA
Join[{0, 2, 19}, LinearRecurrence[{3, -3, 1}, {39, 61, 86}, 50]] (* Harvey P. Dale, Aug 26 2014 *)
PROG
(Magma) [0, 2, 19] cat [n*(3*n+17)/2 -19: n in [4..50]]; // G. C. Greubel, Jan 01 2023
(SageMath) [0, 2, 19]+[n*(3*n+17)/2 -19 for n in range(4, 51)] # G. C. Greubel, Jan 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Oct 12 2002
EXTENSIONS
More terms from Ralf Stephan
STATUS
approved