login
A361134
a(1) = 1, a(2) = 2; for n >= 3, a(n) = (n-1)^3 - a(n-1) - a(n-2).
0
1, 2, 5, 20, 39, 66, 111, 166, 235, 328, 437, 566, 725, 906, 1113, 1356, 1627, 1930, 2275, 2654, 3071, 3536, 4041, 4590, 5193, 5842, 6541, 7300, 8111, 8978, 9911, 10902, 11955, 13080, 14269, 15526, 16861, 18266, 19745, 21308, 22947, 24666, 26475, 28366, 30343
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.
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).
a(n) = (A242135(n) - 6*cos(2*n*Pi/3) + 2*sin(2*n*Pi/3)/sqrt(3))/3. - Stefano Spezia, Mar 04 2023
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 *)
PROG
(PARI) lista(nn) = my(va = vector(nn)); va[1] = 1; va[2] = 2; for (n=3, nn, va[n] = (n-1)^3 - va[n-1] - va[n-2]; ); va; \\ Michel Marcus, Mar 03 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tamas Sandor Nagy, Mar 02 2023
STATUS
approved