OFFSET
1,1
COMMENTS
An integer is k-smooth if it has no prime factors > k.
LINKS
Eric Weisstein's World of Mathematics, Smooth Number
PROG
(Python)
from sympy import integer_log, prime, prevprime
def A133581(n):
if n==1: return 8
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 g(x, m): return sum((x//3**i).bit_length() for i in range(integer_log(x, 3)[0]+1)) if m==3 else sum(g(x//(m**i), prevprime(m))for i in range(integer_log(x, m)[0]+1))
k = prime(n)
def f(x): return k**2+x-g(x, k)
return bisection(f, k**2, k**2) # Chai Wah Wu, Sep 17 2024
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Jonathan Vos Post, Dec 26 2007
EXTENSIONS
Corrected and extended by D. S. McNeil, Dec 08 2010
a(33)-a(40) from Chai Wah Wu, Sep 17 2024
STATUS
approved