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.

A090239 a(n) = A053838(n) + 2 modulo 3.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Feb 04 2004

Keywords

Comments

Can construct sequence by starting with 2 and mapping 0->012, 1->120, 2->201 (e.g., 2, 201, 201012120, ...) and looking at n-th digit of a term with sufficient digits.

Crossrefs

Programs

  • Mathematica
    First[SubstitutionSystem[{0 -> {0, 1, 2}, 1 -> {1, 2, 0}, 2 -> {2, 0, 1}}, 2, {5}]] (* Paolo Xausa, Mar 17 2025 *)
  • PARI
    a(n)=if(n<0,0,2*(n==0),(n+a(n\3))%3) /* Michael Somos, Feb 14 2004 */

Formula

a(n) = mod(n+a([n/3]), 3), a(0)=2. - Michael Somos, Feb 14 2004