cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A361134 a(1) = 1, a(2) = 2; for n >= 3, a(n) = (n-1)^3 - a(n-1) - a(n-2).

Original entry on oeis.org

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

Views

Author

Tamas Sandor Nagy, Mar 02 2023

Keywords

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.

Examples

			a(5) = (5-1)^3 - a(4) - a(3) = 4^3 - 20 - 5 = 64 - 20 - 5 = 39.
		

Crossrefs

Programs

  • 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 *)
  • 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

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