OFFSET
1,2
COMMENTS
The sum of every three consecutive terms is equal to the cube of the index of the middle one, i.e., a(n-1) + a(n) + a(n+1) = n^3.
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-3,3,-1).
FORMULA
G.f.: x*(2*x^5 - 7*x^4 + 9*x^3 + 2*x^2 - x + 1)/((x^2 + x + 1)*(x - 1)^4).
EXAMPLE
a(5) = (5-1)^3 - a(4) - a(3) = 4^3 - 20 - 5 = 64 - 20 - 5 = 39.
MATHEMATICA
a[1] = 1; a[2] = 2; a[n_] := a[n] = (n - 1)^3 - a[n - 1] - a[n - 2]; Array[a, 45] (* Amiram Eldar, Mar 03 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tamas Sandor Nagy, Mar 02 2023
STATUS
proposed