OFFSET
1,1
COMMENTS
Group the set of natural numbers in set of 3 (1, 2, 3; 4, 5, 6; 7, 8, 9; ...) In each group, multiply the first two numbers and then add the third number to the result to get the corresponding entry in our sequence.
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
G.f. -x*(x+5)*(2*x+1) / (x-1)^3 . - Alexander R. Povolotsky, Feb 06 2011
a(n) = a(n-1) + 18*n - 15, a(1) = 5. - Vincenzo Librandi, Feb 07 2011
a(n) = (2*n-1)^2 + (2*n)^2 + (n-1)^2. - Bruno Berselli, Feb 06 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - G. C. Greubel, Feb 25 2017
E.g.f.: (9*x^2 + 3*x + 2)*exp(x) - 2. - G. C. Greubel, Jul 23 2017
MATHEMATICA
CoefficientList[Series[-x*(x + 5)*(2*x + 1)/(x - 1)^3, {x, 0, 50}], x] (* or *) LinearRecurrence[{3, -3, 1}, {5, 26, 65}, 50] (* G. C. Greubel, Feb 25 2017 *)
Table[9n^2-6n+2, {n, 40}] (* or *) #[[1]]#[[2]]+#[[3]]&/@Partition[Range[111], 3] (* Harvey P. Dale, Apr 08 2022 *)
PROG
(PARI) x='x+O('x^50); Vec(-x*(x+5)*(2*x+1)/(x-1)^3) \\ G. C. Greubel, Feb 25 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amir H. Farrahi, Feb 06 2011
STATUS
approved