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.

A191329 (Lower Wythoff sequence mod 2)+(Upper Wythoff sequence mod 2).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2011

Keywords

Comments

Let r=(golden ratio)=(1+sqrt(5))/2 and let [ ]=floor. Let u(n)=[nr] and v(n)=n+[nr], so that u=A000201, v=A001950, the Wythoff sequences, and A191329=(u mod 2)+(v mod 2)=(number of odd numbers in {[nr],[ns]}).
The sequence A191329 can also be obtained by placing 1 before each term of 2*A078588.

Examples

			u = (1,3,4,6,8,9,...)... = (1,1,0,0,0,1,...) in mod 2
v = (2,5,7,10,13,15,...) = (0,1,1,0,1,1,...) in mod 2,
so that......... A191329 = (1,2,1,0,1,2,...).
		

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; s = r/(r - 1); h = 500;
    u = Table[Floor[n*r], {n, 1, h}]  (* A000201 *)
    v = Table[Floor[n*s], {n, 1, h}]  (* A001950 *)
    w = Mod[u, 2] + Mod[v, 2]  (* A191329 *)
    b = Flatten[Position[w, 0]]  (* A191330=2*A005653 *)
    c = Flatten[Position[w, 1]]  (* A005408, the odds *)
    d = Flatten[Position[w, 2]]  (* A191331=2*A005652 *)
    e = b/2; (* A005653 *)
    f = d/2; (* A005652 *)
    x = (1/3)^b; z = (1/3)^d;
    k[n_] := x[[n]]; x1 = Sum[k[n], {n, 1, 100}];
    N[x1, 100]
    RealDigits[x1, 10, 100]  (* A191332 *)
    k[n_] := z[[n]]; z1 = Sum[k[n], {n, 1, 100}];
    N[z1, 100]
    RealDigits[z1, 10, 100]  (* A191333 *)
    N[x1 + z1, 100] (* Checks that x1+z1=1/8 *)
    x = (1/3)^e; z = (1/3)^f;
    k[n_] := x[[n]]; x2 = Sum[k[n], {n, 1, 100}];
    N[x2, 100]
    RealDigits[x2, 10, 100]  (* A191334 *)
    k[n_] := z[[n]]; z2 = Sum[k[n], {n, 1, 100}];
    N[z2, 100]
    RealDigits[z2, 10, 100]  (* A191335 *)
    N[x2 + z2, 100] (* checks that x2+z2=1/2 *)
  • PARI
    A191329(n) = { my(y=n+sqrtint(n^2*5)); (((y+n+n)\2)%2) + ((y%4)>1); }; \\ (after programs in A001950 and A085002) - Antti Karttunen, May 19 2021
    
  • Python
    from math import isqrt
    def A191329(n): return m if (m:=((n+isqrt(5*n**2))&2)+(n&1))<3 else 1 # Chai Wah Wu, Aug 10 2022

Formula

a(n) = (A000201(n) mod 2) + (A001950(n) mod 2).
a(n) = A085002(n) + A171587(n). - Michel Dekking, Jan 28 2021