[go: up one dir, main page]

login
A099997
Bisection of A001597.
1
1, 8, 16, 27, 36, 64, 100, 125, 144, 196, 225, 256, 324, 361, 441, 512, 576, 676, 784, 900, 1000, 1089, 1225, 1331, 1444, 1600, 1728, 1849, 2025, 2116, 2197, 2304, 2500, 2704, 2809, 3025, 3136, 3364, 3481, 3721, 3969, 4225, 4489, 4761, 4913, 5184, 5476
OFFSET
1,2
MATHEMATICA
t = Union@ Flatten@ Join[{1}, Table[ n^i, {n, 2, Sqrt[5775]}, {i, 2, Log[n, 5775]}]]; t[[2# - 1]] & /@ Range@(Length@t/2) (* Robert G. Wilson v *)
PROG
(Python)
from sympy import mobius, integer_nthroot
def A099997(n):
def f(x): return int((n<<1)-3+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 kmax # Chai Wah Wu, Aug 14 2024
CROSSREFS
Sequence in context: A111307 A246549 A076405 * A053093 A175086 A348231
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 20 2004
EXTENSIONS
More terms from Robert G. Wilson v, Dec 14 2005
STATUS
approved