This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A342872 #19 Apr 13 2021 18:29:45 %S A342872 0,1,2,3,2,1,0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9, %T A342872 10,11,12,13,14,15,16,17,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1, %U A342872 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 %N A342872 Distance to nearest product of 3 consecutive numbers (three-dimensional promic number, A007531). %H A342872 Lamine Ngom, <a href="/A342872/b342872.txt">Table of n, a(n) for n = 0..10000</a> %e A342872 a(13) = 7 since 6 is the closest three-dimensional promic to 13 and 13 - 6 = 7. %o A342872 (Python) %o A342872 def a(n): return min(abs(n-k*(k+1)*(k+2)) for k in range(int(n**1/3)+1)) %o A342872 print([a(n) for n in range(78)]) # _Michael S. Branicky_, Mar 28 2021 %Y A342872 Cf. A007531, A342873. %Y A342872 Other distance to nearest: A081134, A053646, A201053. %K A342872 nonn,easy %O A342872 0,3 %A A342872 _Lamine Ngom_, Mar 28 2021