OFFSET
0,4
COMMENTS
EXAMPLE
a(8)=7, because the two cubes below and above 8 are 1^3=1 and 3^3=27, and the distance to 1 is smaller, namely 8-1=7.
MAPLE
MATHEMATICA
dnc[n_]:=Module[{c=Surd[n, 3]}, If[IntegerQ[c], n-(c-1)^3, Min[n-Floor[ c]^3, Ceiling[c]^3-n]]]; Array[dnc, 90, 0] (* Harvey P. Dale, Mar 30 2019 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. J. Mathar, Nov 01 2009
STATUS
approved