login
A373549
a(n) is the parity of the n-th powerful number.
3
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1
OFFSET
1
LINKS
Teerapat Srichan, The odd/even dichotomy for the set of square-full numbers, Applied Mathematics E-Notes, Vol. 20 (2020), pp. 528-531.
Wikipedia, Powerful number.
FORMULA
a(n) = A001694(n) mod 2 = A000035(A001694(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = (2 - sqrt(2))/(3 - sqrt(2)) = 0.3693980625... .
MATHEMATICA
Mod[Select[Range[5000], # == 1 || Min[FactorInteger[#][[;; , 2]]] > 1 &], 2]
PROG
(PARI) lista(kmax) = for(k = 1, kmax, if(ispowerful(k), print1(k % 2, ", ")));
(Python)
from math import isqrt
from sympy import mobius, integer_nthroot
def A373549(n):
def squarefreepi(n):
return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x):
c, l = n+x, 0
j = isqrt(x)
while j>1:
k2 = integer_nthroot(x//j**2, 3)[0]+1
w = squarefreepi(k2-1)
c -= j*(w-l)
l, j = w, isqrt(x//k2**3)
c -= squarefreepi(integer_nthroot(x, 3)[0])-l
return c
return bisection(f, n, n)&1 # Chai Wah Wu, Sep 10 2024
CROSSREFS
Characteristic function of A363189.
Sequence in context: A005171 A283265 A365410 * A181406 A285252 A076404
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Jun 09 2024
STATUS
approved