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.

A322462 Numbers on the 0-1-12 line in a spiral on a grid of equilateral triangles.

Original entry on oeis.org

0, 1, 12, 13, 36, 37, 72, 73, 120, 121, 180, 181, 252, 253, 336, 337, 432, 433, 540, 541, 660, 661, 792, 793, 936, 937, 1092, 1093, 1260, 1261, 1440, 1441, 1632, 1633, 1836, 1837, 2052, 2053, 2280, 2281, 2520, 2521, 2772, 2773, 3036, 3037, 3312, 3313, 3600
Offset: 0

Views

Author

Hans G. Oberlack, Dec 09 2018

Keywords

Comments

Sequence found by reading the line from 0, in the direction 0, 1, 12, ... in the triangle spiral.

Examples

			a(0) = 0
a(1) = a(1 - 1) + 1 = 0 + 1
a(2) = (3/2) * 2 * (2 + 2) = 3 * 4 = 12
a(3) = a(3 - 1) + 1 = 12 + 1 = 13
a(4) = (3/2) * 4*(4 + 2) = 3 * 2 * 6 = 6 * 6 = 36
a(5) = a(4) + 1 = 36 + 1 = 37.
		

Crossrefs

Cf. A049598.

Programs

  • Maple
    seq(coeff(series(-x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3),x,n+1), x, n), n = 0 .. 50); # Muniru A Asiru, Dec 19 2018
  • Mathematica
    a[0] = 0; a[n_] := a[n] = If[OddQ[n], a[n - 1] + 1, 3/2*n*(n + 2)]; Array[a, 50, 0] (* Amiram Eldar, Dec 09 2018 *)
  • PARI
    concat(0, Vec(x*(1 + 11*x - x^2 + x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Dec 09 2018

Formula

a(n) = (3/2)*n*(n+2) = A049598(n/2) if n even, a(n) = a(n-1)+1 if n odd.
G.f.: -x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Dec 09 2018
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4. - Colin Barker, Dec 09 2018

Extensions

Examples added by Hans G. Oberlack, Dec 20 2018