login
A373550
a(n) is the parity of the n-th squarefree number.
5
1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1
OFFSET
1
LINKS
FORMULA
a(n) = A005117(n) mod 2 = A000035(A005117(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/3.
MATHEMATICA
Mod[Select[Range[200], SquareFreeQ], 2]
PROG
(PARI) lista(kmax) = for(k = 1, kmax, if(issquarefree(k), print1(k % 2, ", ")));
(Python)
from math import isqrt
from sympy import mobius
def A373550(n):
def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m&1 # Chai Wah Wu, Aug 12 2024
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Jun 09 2024
STATUS
approved