OFFSET
1,1
COMMENTS
a(n) is the number of integer values (x, y) strictly inside the circle x^2+y^2=n^2, plus half the number of such lattice points that are part of the perimeter of that circle.
All terms are odd. - Chai Wah Wu, Aug 23 2025
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A256465(n^2). - R. J. Mathar, Aug 26 2025
EXAMPLE
The unit circle has 1 lattice point strictly inside it and 5 lattice points not outside it. Halfway between 1 and 5 is 3, so a(1) = 3.
PROG
(PARI) a(n) = {4*n -1 + 2*sum(k=1, n-1, my(t=n^2-k^2); 2*sqrtint(t)-issquare(t))} \\ Andrew Howroyd, Aug 22 2025
(Python)
from math import isqrt
def A387220(n): return 1+(sum(isqrt(m:=k*((n<<1)-k))+isqrt(m-1) for k in range(1, n+1))<<1) # Chai Wah Wu, Aug 23 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Lorraine Lee, Aug 22 2025
STATUS
approved
