login
A174060
a(n) = Sum_{k=0..n} floor(sqrt(k))^2.
4
0, 1, 2, 3, 7, 11, 15, 19, 23, 32, 41, 50, 59, 68, 77, 86, 102, 118, 134, 150, 166, 182, 198, 214, 230, 255, 280, 305, 330, 355, 380, 405, 430, 455, 480, 505, 541, 577, 613, 649, 685, 721, 757, 793, 829, 865, 901, 937, 973, 1022, 1071, 1120, 1169, 1218, 1267, 1316
OFFSET
0,3
COMMENTS
Partial sums of A048760. - R. J. Mathar, Mar 31 2010
LINKS
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]
for n in range(1, 56): A174060.append(A174060[-1] + isqrt(n)**2)
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
Cf. A022554 (1st), this sequence (2nd), A363497 (3rd).
Cf. A363498 (4th), A363499 (5th), A048760.
Sequence in context: A323353 A188529 A369692 * A285278 A092353 A189374
KEYWORD
nonn,easy
AUTHOR
STATUS
approved