Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Aug 11 2022 03:19:32
%S 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,
%T 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,
%U 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
%N (Lower Wythoff sequence mod 2)+(Upper Wythoff sequence mod 2).
%C 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]}).
%C The sequence A191329 can also be obtained by placing 1 before each term of 2*A078588.
%H Antti Karttunen, <a href="/A191329/b191329.txt">Table of n, a(n) for n = 1..65537</a>
%F a(n) = (A000201(n) mod 2) + (A001950(n) mod 2).
%F a(n) = A085002(n) + A171587(n). - _Michel Dekking_, Jan 28 2021
%e u = (1,3,4,6,8,9,...)... = (1,1,0,0,0,1,...) in mod 2
%e v = (2,5,7,10,13,15,...) = (0,1,1,0,1,1,...) in mod 2,
%e so that......... A191329 = (1,2,1,0,1,2,...).
%t r = GoldenRatio; s = r/(r - 1); h = 500;
%t u = Table[Floor[n*r], {n, 1, h}] (* A000201 *)
%t v = Table[Floor[n*s], {n, 1, h}] (* A001950 *)
%t w = Mod[u, 2] + Mod[v, 2] (* A191329 *)
%t b = Flatten[Position[w, 0]] (* A191330=2*A005653 *)
%t c = Flatten[Position[w, 1]] (* A005408, the odds *)
%t d = Flatten[Position[w, 2]] (* A191331=2*A005652 *)
%t e = b/2; (* A005653 *)
%t f = d/2; (* A005652 *)
%t x = (1/3)^b; z = (1/3)^d;
%t k[n_] := x[[n]]; x1 = Sum[k[n], {n, 1, 100}];
%t N[x1, 100]
%t RealDigits[x1, 10, 100] (* A191332 *)
%t k[n_] := z[[n]]; z1 = Sum[k[n], {n, 1, 100}];
%t N[z1, 100]
%t RealDigits[z1, 10, 100] (* A191333 *)
%t N[x1 + z1, 100] (* Checks that x1+z1=1/8 *)
%t x = (1/3)^e; z = (1/3)^f;
%t k[n_] := x[[n]]; x2 = Sum[k[n], {n, 1, 100}];
%t N[x2, 100]
%t RealDigits[x2, 10, 100] (* A191334 *)
%t k[n_] := z[[n]]; z2 = Sum[k[n], {n, 1, 100}];
%t N[z2, 100]
%t RealDigits[z2, 10, 100] (* A191335 *)
%t N[x2 + z2, 100] (* checks that x2+z2=1/2 *)
%o (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
%o (Python)
%o from math import isqrt
%o def A191329(n): return m if (m:=((n+isqrt(5*n**2))&2)+(n&1))<3 else 1 # _Chai Wah Wu_, Aug 10 2022
%Y Cf. A000201, A001950, A085002, A171587, A191330, A191331.
%K nonn
%O 1,2
%A _Clark Kimberling_, May 31 2011