|
|
A175064
|
|
a(1) = 1; for n >= 2, a(n) = number of ways h to write the n-th perfect power A001597(n) as m^k with m >= 2 and k >= 1.
|
|
10
|
|
|
1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 4, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Perfect powers with first occurrence of h >= 2: 4, 16, 64, 65536, 4096, ...
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n = 11: A001597(11) = 64; there are 4 ways to write 64 as m^k: 64^1 = 8^2 = 4^3 = 2^6.
|
|
PROG
|
(Python)
from math import gcd
from sympy import mobius, integer_nthroot, divisor_count, factorint
if n == 1: return 1
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())) # Chai Wah Wu, Aug 13 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|