OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
EXAMPLE
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,...).
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 *)
c = Flatten[Position[w, 1]] (* A005408, the odds *)
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 31 2011
STATUS
approved