login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A154840 Distance to nearest cube different from n. 3
1, 1, 1, 2, 3, 3, 2, 1, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 19, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 37, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
Equals A074989(n) if this is not zero, else 1+A055400(n-1), the distance to the nearest cube < n.
LINKS
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
distNearstDiffCub := proc(n) local iscbr ; iroot(n, 3, 'iscbr') ; if iscbr then 1+A055400(n-1); else A074989(n) ; end if; end proc;
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
Sequence in context: A156613 A285555 A078041 * A309995 A205102 A348760
KEYWORD
nonn,easy
AUTHOR
R. J. Mathar, Nov 01 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:06 EDT 2024. Contains 371962 sequences. (Running on oeis4.)