OFFSET
0,6
LINKS
Stefano Spezia, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = Sum_{k=1..floor(sqrt(n))} floor(sqrt(n-k^2)). - M. F. Hasler, Feb 09 2014
G.f.: (theta_3(x) - 1)^2/(4*(1 - x)), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018
For n > 1, Pi*(n+2-sqrt(8n)) < a(n) < Pi*n. (This is trivial and can probably be improved by methods like Euler-Maclaurin and perhaps even a modification of the Dirichlet hyperbola method.) - Charles R Greathouse IV, Jul 17 2024
MATHEMATICA
a[n_]:=Sum[Floor[Sqrt[n-k^2]], {k, Floor[Sqrt[n]]}]; Array[a, 70, 0] (* Stefano Spezia, Jul 19 2024 *)
PROG
(PARI) A237526(n)=sum(k=1, sqrtint(n), sqrtint(n-k^2)) \\ M. F. Hasler, Feb 09 2014
(Python)
from math import isqrt
def A237526(n): return sum(isqrt(n-k**2) for k in range(1, isqrt(n)+1)) # Chai Wah Wu, Jul 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
L. Edson Jeffery, Feb 09 2014
STATUS
approved