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.

A159955 Period 9: repeat [0, 1, 2, 1, 2, 0, 2, 0, 1].

Original entry on oeis.org

0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 2, 0, 1
Offset: 0

Views

Author

Philippe Deléham, Apr 27 2009

Keywords

Programs

  • Magma
    &cat[[0, 1, 2, 1, 2, 0, 2, 0, 1]^^15]; // Vincenzo Librandi, Mar 24 2016
  • Mathematica
    PadRight[{}, 120, {0, 1, 2, 1, 2, 0, 2, 0, 1}] (* Vincenzo Librandi, Mar 24 2016 *)

Formula

a(n+9) = a(n) with a(0) = a(5) = a(7) = 0, a(1) = a(3) = a(8) = 1, a(2) = a(4) = a(6) = 2.
a(n) = floor((4*n-9)/3) mod 3. - Gary Detlefs, May 15 2011
a(n) = (n + floor(n/3)) mod 3. - William Walkington, Mar 22 2016
From Chai Wah Wu, Jul 30 2020: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) - a(n-6) + a(n-7) for n > 6.
G.f.: x*(-x^5 + x^4 - 2*x^3 + x^2 - x - 1)/((x - 1)*(x^6 + x^3 + 1)). (End)