A077119 a(n) = A077118(n) - n^3.
0, 0, 1, -2, 0, -4, 9, 18, 17, 0, 24, -35, 36, 12, -40, -11, 0, -13, -56, 30, -79, -45, -39, -67, 100, 0, 113, -83, -48, -53, -104, 138, -7, 163, -100, -26, 0, -28, -116, 217, 9, 248, -104, 17, 80, 79, 8, -139, 297, 0, 316, -155, 17, 119, 145, 89, -55
Offset: 0
Keywords
Examples
A077118(10)=1024=32^2 is the nearest square to 10^3=1000, therefore a(10)=1024-1000=24.
Programs
-
Magma
[Round(Sqrt(n^3))^2-n^3: n in [0..60]]; // Vincenzo Librandi, Mar 24 2015
-
Maple
A077119 := proc(n) (round( sqrt(n^3) ))^2-n^3 ; end proc: # R. J. Mathar, Jan 18 2021
-
Mathematica
Table[Round[Sqrt[x^3]]^2 - x^3, {x, 0, 100}] (* Artur Jasinski, Nov 30 2011 *)
-
Python
from math import isqrt def A077119(n): return ((m:=isqrt(k:=n**3))+int((k-m*(m+1)<<2)>=1))**2-k # Chai Wah Wu, Jul 29 2022
Comments