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.

A344893 Fixed point of the morphism 1->1321, 2->0021, 3->1300, 0->0000 starting from 1.

Original entry on oeis.org

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

Views

Author

Kevin Ryde, Jun 01 2021

Keywords

Comments

Loxton and van der Poorten give this morphism as a way to identify those n which can be represented in base 4 using only digits -1,0,+1 (A006288): n is a term of A006288 iff a(n) = 1 or 3.

Crossrefs

Cf. A006288, A344892, A007090 (base 4).

Programs

  • Mathematica
    Nest[Flatten[ReplaceAll[#,{0->{0,0,0,0},1->{1,3,2,1},2->{0,0,2,1},3->{1,3,0,0}}]]&,{1},4] (* Paolo Xausa, Nov 09 2023 *)
  • PARI
    my(table=[9,8,9,0,0,8,6,2,4]); a(n) = my(s=2); if(n, forstep(i=bitor(logint(n,2),1),0,-1, (s=table[s-bittest(n,i)])||break)); s>>1;

Formula

a(n) = 0 if n in base 4 has a digit pair 12, 13, 20, or 21; otherwise a(n) = 1,3,2,1 according as n == 0,1,2,3 (mod 4).