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.

A191336 (A022838 mod 2)+(A054406 mod 2).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jun 01 2011

Keywords

Comments

A022838: Beatty sequence for r=sqrt(3),
A054406: Beatty sequence for s=(3+sqrt(3))/2 (complement
of A022838), so that
A191336(n)=([nr] mod 2)+([ns] mod 2), where [ ]=floor.
A191336(n)=(number of odd numbers in {[nr],[ns]}).

Crossrefs

Programs

  • Mathematica
    r = Sqrt[3]; s = r/(r - 1); h = 320;
    u = Table[Floor[n*r], {n, 1, h}] (* A022838 *)
    v = Table[Floor[n*s], {n, 1, h}] (* A054406 *)
    w = Mod[u, 2] + Mod[v, 2] (* A191336 *)
    Flatten[Position[w, 0]]   (* A191337 *)
    Flatten[Position[w, 1]]   (* A191338 *)
    Flatten[Position[w, 2]]   (* A191339 *)

Formula

a(n)=([nr] mod 2)+([ns] mod 2), where r=sqrt(3), s=r/(r-1), and [ ]=floor.