OFFSET
0,3
COMMENTS
Partial sums of A048760. - R. J. Mathar, Mar 31 2010
LINKS
Karl-Heinz Hofmann, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = (1/6)*m*(6*m*n - (m+1)*(3*m^2+m-1)) with m = floor(sqrt(n)). - Yalcin Aktar, Jan 30 2012
MATHEMATICA
Accumulate[Table[Floor[Sqrt[k]]^2, {k, 0, 59}]] (* Harvey P. Dale, Jul 13 2013 *)
PROG
(PARI) a(n)=my(m=sqrtint(n+1)); (n+1)*m^2-m*(m+1)*(3*m^2+m-1)/6 \\ Charles R Greathouse IV, Jul 04 2013
(PARI) a(n) = sum(k=0, n, sqrtint(k)^2); \\ Karl-Heinz Hofmann, Jun 15 2023
(Python)
from math import isqrt
A174060 = [0]
print(A174060) # Karl-Heinz Hofmann, Jun 15 2023
(Python)
from math import isqrt
def A174060(n): return ((m:=isqrt(n+1))*(6*m*(n+1) - (m+1)*(3*m**2+m-1)))//6
# Karl-Heinz Hofmann, Jun 15 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Mar 06 2010
STATUS
approved