login
A077110
Nearest integer cube to n^2.
8
0, 1, 1, 8, 8, 27, 27, 64, 64, 64, 125, 125, 125, 125, 216, 216, 216, 343, 343, 343, 343, 512, 512, 512, 512, 729, 729, 729, 729, 729, 1000, 1000, 1000, 1000, 1000, 1331, 1331, 1331, 1331, 1331, 1728, 1728, 1728, 1728, 1728, 2197, 2197, 2197
OFFSET
0,4
FORMULA
a(n) = if A075847(n) < A070923(n) then A077106(n) else A077107(n).
EXAMPLE
a(10)=125, as 125=5^3 is the nearest cube to 100=10^2.
MATHEMATICA
nic[n_]:=Module[{n2=n^2, s3, c1, c2}, s3=Surd[n2, 3]; c1=Floor[s3]^3; c2= Ceiling[ s3]^3; If[n2-c1<c2-n2, c1, c2]]; Array[nic, 50, 0] (* Harvey P. Dale, Jul 05 2015 *)
PROG
(Python)
from sympy import integer_nthroot
def A077110(n):
n2 = n**2
a = integer_nthroot(n2, 3)[0]
a2, a3 = a**3, (a+1)**3
return a3 if a3+a2-2*n2 < 0 else a2 # Chai Wah Wu, Sep 24 2021
CROSSREFS
Cf. A002760 (Squares and cubes). - Zak Seidov, Oct 08 2015
Sequence in context: A318542 A319089 A003873 * A333625 A098360 A133038
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 29 2002
STATUS
approved