OFFSET
1,5
COMMENTS
Run lengths of A072103. Also, the terms a(n) which exceed 1 constitute A175066. - Andrey Zabolotskiy, Aug 17 2016
EXAMPLE
PROG
(PARI) for(n=1, 9999, (e=ispower(n))&&print1(numdiv(e)-1, ", "))
(Python)
from math import gcd
from sympy import mobius, integer_nthroot, divisor_count, factorint
def A253642(n):
if n == 1: return 0
def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length())))
kmin, kmax = 1, 2
while f(kmax) >= kmax:
kmax <<= 1
while True:
kmid = kmax+kmin>>1
if f(kmid) < kmid:
kmax = kmid
else:
kmin = kmid
if kmax-kmin <= 1:
break
return divisor_count(gcd(*factorint(kmax).values()))-1 # Chai Wah Wu, Aug 13 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Jan 25 2015
STATUS
approved