A342873 Numbers whose distance to the nearest cube equals the distance to the nearest product of 3 consecutive integers (three-dimensional oblong).
0, 7, 16, 62, 92, 213, 276, 508, 616, 995, 1160, 1722, 1956, 2737, 3052, 4088, 4496, 5823, 6336, 7990, 8620, 10637, 11396, 13812, 14712, 17563, 18616, 21938, 23156, 26985, 28380, 32752, 34336, 39287, 41072, 46638, 48636, 54853, 57076, 63980, 66440, 74067
Offset: 1
Programs
-
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)] return [m for m in range(limit+1) if A074989[m] == A342872[m]] print(aupto(10**4)) # Michael S. Branicky, Mar 28 2021
Comments