cp's OEIS Frontend

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.

A077110 Nearest integer cube to n^2.

This page as a plain text file.
%I A077110 #24 Apr 06 2025 08:45:49
%S A077110 0,1,1,8,8,27,27,64,64,64,125,125,125,125,216,216,216,343,343,343,343,
%T A077110 512,512,512,512,729,729,729,729,729,1000,1000,1000,1000,1000,1331,
%U A077110 1331,1331,1331,1331,1728,1728,1728,1728,1728,2197,2197,2197
%N A077110 Nearest integer cube to n^2.
%H A077110 Amiram Eldar, <a href="/A077110/b077110.txt">Table of n, a(n) for n = 0..10000</a>
%F A077110 a(n) = if A075847(n) < A070923(n) then A077106(n) else A077107(n).
%e A077110 a(10) = 125, as 125 = 5^3 is the nearest cube to 100 = 10^2.
%t A077110 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 *)
%o A077110 (Python)
%o A077110 from sympy import integer_nthroot
%o A077110 def A077110(n):
%o A077110     n2 = n**2
%o A077110     a = integer_nthroot(n2,3)[0]
%o A077110     a2, a3 = a**3, (a+1)**3
%o A077110     return a3 if a3+a2-2*n2 < 0 else a2 # _Chai Wah Wu_, Sep 24 2021
%Y A077110 Cf. A000578, A000290, A075847, A070923, A077106, A077107, A077111, A077118.
%Y A077110 Cf. A002760 (Squares and cubes). - _Zak Seidov_, Oct 08 2015
%K A077110 nonn,easy
%O A077110 0,4
%A A077110 _Reinhard Zumkeller_, Oct 29 2002