OFFSET
1,2
COMMENTS
PROG
(Python)
def aupto(limit):
cubes = [k**3 for k in range(int((limit+1)**1/3)+2)]
proms = [k*(k+1)*(k+2) for k in range(int((limit+1)**1/3)+1)]
A074989 = [min(abs(n-c) for c in cubes) for n in range(limit+1)]
A342872 = [min(abs(n-p) for p in proms) for n in range(limit+1)]
print(aupto(10**4)) # Michael S. Branicky, Mar 28 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lamine Ngom, Mar 28 2021
STATUS
approved