OFFSET
1,2
COMMENTS
LINKS
Martin Y. Champel, Table of n, a(n) for n = 1..9999
New Scientist, Enigma 1777. Powerful tombola, by Susan Denham, November 2013.
EXAMPLE
n=1: a(1)=1 as the only perfect power <= 1 is 1.
n=2: a(2)=2 as the only perfect power <= 2 is 1, and 2=2*1.
n=3: a(3)=3 as the only perfect power <= 3 is 1, and 3=3*1.
n=4: a(4)=20 as (1,4,8,9,16) are 5 perfect powers smaller than 20 and 20 = 4*5.
n=5: a(5)=45 as (1,4,8,9,16,25,27,32,36) are 9 perfect powers smaller than 45 and 45 = 5*9.
PROG
(Python)
# requires python code of A001597
class A233410() :
def __init__(self) :
self.a001597 = A001597()
def perf_pows_up_to(self, n):
idx = 1
while True:
if self.a001597.at(idx) > n :
return idx-1
idx += 1
def at(self, n):
k = 1
while True :
m = k*n
if self.perf_pows_up_to(m) <= k:
return m
k += 1
a233410 = A233410()
for n in range(1, 20):
print(a233410.at(n)) # R. J. Mathar, Mar 29 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Martin Y. Champel, Dec 09 2013
STATUS
approved