OFFSET
1,1
COMMENTS
Old Name was: A sequence based on odd numbers of the type 3*n + 2: a(n) = a(n - 1) + n - 1; A000096; f(n) = 3*a(n)+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
From Colin Barker, Apr 14 2014: (Start)
a(n) = (4 - 9*n + 3*n^2)/2 for n>1.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>4.
G.f.: x*(2 - 7*x + 11*x^2 - 3*x^3)/ (1-x)^3. (End).
E.g.f.: (1/2)*(4 - 6*x + 3*x^2)*exp(x) - 2 + 3*x. - G. C. Greubel, Jul 19 2024
EXAMPLE
G.f. = 2*x - x^2 + 2*x^3 + 8*x^4 + 17*x^5 + 29*x^6 + 44*x^7 + 62*x^8 + ...
MATHEMATICA
a[0] = 0; a[1] = -1; a[n_] := a[n] = a[n - 1] + n - 1; a1 = Table[a[n], {n, 0, 30}]; f[n_] := 3*a[n] + 2; Table[f[n], {n, 0, 50}]
LinearRecurrence[{3, -3, 1}, {2, -1, 2, 8}, 60] (* Harvey P. Dale, Mar 22 2018 *)
PROG
(PARI) Vec(x*(3*x^3-11*x^2+7*x-2)/(x-1)^3 + O(x^100)) \\ Colin Barker, Apr 14 2014
(Magma) [n eq 1 select 2 else (4-9*n+3*n^2)/2: n in [1..60]]; // G. C. Greubel, Jul 19 2024
(SageMath) [(4-9*n+3*n^2)/2 + 3*int(n==1) for n in range(1, 61)] # G. C. Greubel, Jul 19 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula and Gary W. Adamson, Oct 20 2008
EXTENSIONS
Better name and edits by Colin Barker and Joerg Arndt, Apr 14 2014
STATUS
approved