OFFSET
0,2
COMMENTS
Number of ordered pairs of integers (x,y) with x^2 + y^2 <= n^2.
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
H. Gupta, A Table of Values of N_3(t), Proc. National Institute of Sciences of India, 13 (1947), 35-63.
C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 47.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
T. D. Noe and Robert Israel, Table of n, a(n) for n = 0..10000 (n=0..1000 from T. D. Noe)
W. Fraser and C. C. Gotlieb, A calculation of the number of lattice points in the circle and sphere, Math. Comp., 16 (1962), 282-290.
Eric Weisstein's World of Mathematics, Gauss's Circle Problem
FORMULA
a(n) = 1 + 4 * Sum_{j>=0} floor(n^2/(4*j+1)) - floor(n^2/(4*j+3)). Also a(n) = A057655(n^2). - Max Alekseyev, Nov 18 2007
a(n) = 4*A000603(n) - (4*n+3), n >= 0. - Wolfdieter Lang, Mar 15 2015
a(n) = 1+4*n^2-4*ceiling((n-1)/sqrt(2))-8*A247588(n-1), n>1. - Mats Granvik, May 23 2015
a(n) = [x^(n^2)] theta_3(x)^2/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018
MATHEMATICA
Table[Sum[SquaresR[2, k], {k, 0, n^2}], {n, 0, 46}]
PROG
(PARI) { a(n) = 1 + 4 * sum(j=0, n^2\4, n^2\(4*j+1) - n^2\(4*j+3) ) } /* Max Alekseyev, Nov 18 2007 */
(Haskell)
a000328 n = length [(x, y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n^2]
-- Reinhard Zumkeller, Jan 23 2012
(Python)
def A000328(n):
return (sum([int((n**2 - y**2)**0.5) for y in range(1, n)]) * 4 + 4*n + 1)
# Karl-Heinz Hofmann, Aug 03 2022
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from David W. Wilson, May 22 2000
Edited at the suggestion of Max Alekseyev by N. J. A. Sloane, Nov 18 2007
Incorrect comment removed by Eric M. Schmidt, May 28 2015
STATUS
approved