OFFSET
0,3
LINKS
Lamine Ngom, Table of n, a(n) for n = 0..10000
EXAMPLE
a(13) = 7 since 6 is the closest three-dimensional promic to 13 and 13 - 6 = 7.
PROG
(Python)
def a(n): return min(abs(n-k*(k+1)*(k+2)) for k in range(int(n**1/3)+1))
print([a(n) for n in range(78)]) # Michael S. Branicky, Mar 28 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lamine Ngom, Mar 28 2021
STATUS
approved