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.

A080458 a(1)=4; for n>1, a(n)=a(n-1) if n is already in the sequence, a(n)=a(n-1)+4 otherwise.

Original entry on oeis.org

4, 8, 12, 12, 16, 20, 24, 24, 28, 32, 36, 36, 40, 44, 48, 48, 52, 56, 60, 60, 64, 68, 72, 72, 76, 80, 84, 84, 88, 92, 96, 96, 100, 104, 108, 108, 112, 116, 120, 120, 124, 128, 132, 132, 136, 140, 144, 144, 148, 152, 156, 156, 160, 164, 168, 168, 172, 176
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {4, 8, 12, 12, 16}, 60] (* Jean-François Alcover, Sep 20 2018 *)
  • PARI
    a(n) = 4 + 4*(n-2-(n-4)\4); \\ Michel Marcus, May 06 2016

Formula

a(n) = 4 + 4*(n-2-floor((n-4)/4)).
From Chai Wah Wu, Jul 17 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: 4*x*(x^2 + x + 1)/(x^5 - x^4 - x + 1). (End)
From Ilya Gutkovskiy, Jul 17 2016: (Start)
E.g.f.: (3*x + 1)*cosh(x) + (3*x + 2)*sinh(x) - cos(x) - sin(x).
a(n) = (6*n - (-1)^n - 2*sqrt(2)*sin(Pi*n/2+Pi/4) + 3)/2. (End)