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.

A080455 a(1)=1; 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

1, 5, 9, 13, 13, 17, 21, 25, 25, 29, 33, 37, 37, 41, 45, 49, 49, 53, 57, 61, 61, 65, 69, 73, 73, 77, 81, 85, 85, 89, 93, 97, 97, 101, 105, 109, 109, 113, 117, 121, 121, 125, 129, 133, 133, 137, 141, 145, 145, 149, 153, 157, 157, 161, 165, 169, 169, 173
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2003

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 1, -1}, {1, 5, 9, 13, 13}, 58] (* Jean-François Alcover, Sep 21 2017 *)
  • PARI
    Vec(-x*(x^4-4*x^3-4*x^2-4*x-1)/((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 16 2013

Formula

For m>=1, a(4m) = a(4m+1) = 12m+1, a(4m+2) = 12m+5, a(4m+3) = 12m+9.
Or, shorter: a(n) = 4*n+1- 4*floor((n+3)/4). - Benoit Cloitre, Mar 20 2003
From Colin Barker, Oct 16 2013: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: -x*(x^4 - 4*x^3 - 4*x^2 - 4*x - 1) / ((x-1)^2*(x+1)*(x^2+1)). (End)