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.

A089650 a(n) = A089649(n) mod 3.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Jan 02 2004

Keywords

Comments

Partial sums, modulo 3, of the sequence: a(1)=1, a(1), a(1), a(1), a(2), a(2), a(2), a(3), a(3), ... each term repeated 3 times.

Programs

  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {0 -> {1, 1, 1}, 1 -> {1, 2, 0}, 2 -> {1, 0, 2}})]}], {0}, 5] (* Robert G. Wilson v, Feb 26 2005 *)
  • PARI
    a(n)=if(n<2,1,(a(n-1)+a(floor((n+1)/3)))%3)

Formula

A fixed point of the morphism 1->120, 2->102, 0->111.