# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a057655
Showing 1-1 of 1
%I A057655 #73 Oct 03 2024 17:16:58
%S A057655 1,5,9,9,13,21,21,21,25,29,37,37,37,45,45,45,49,57,61,61,69,69,69,69,
%T A057655 69,81,89,89,89,97,97,97,101,101,109,109,113,121,121,121,129,137,137,
%U A057655 137,137,145,145,145,145,149,161,161,169,177,177,177
%N A057655 The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n.
%D A057655 C. Alsina and R. B. Nelsen, Charming Proofs: A Journey Into Elegant Mathematics, Math. Assoc. Amer., 2010, p. 42.
%D A057655 J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
%D A057655 F. Fricker, Einfuehrung in die Gitterpunktlehre, Birkhäuser, Boston, 1982.
%D A057655 P. de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 5.
%D A057655 E. Kraetzel, Lattice Points, Kluwer, Dordrecht, 1988.
%D A057655 C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 51.
%D A057655 W. Sierpiński, Elementary Theory of Numbers, Elsevier, North-Holland, 1988.
%H A057655 T. D. Noe, Table of n, a(n) for n = 0..1000
%H A057655 Pierre de la Harpe, On the prehistory of growth of groups, arXiv:2106.02499 [math.GR], 2021.
%H A057655 F. Richman, Counting Gaussian integers in a disk
%H A057655 W. Sierpiński, Elementary Theory of Numbers, Warszawa 1964.
%F A057655 a(n) = 1 + 4*{ [n/1] - [n/3] + [n/5] - [n/7] + ... }. - Gauss
%F A057655 a(n) = 1 + 4*Sum_{ k = 0 .. [sqrt(n)] } [ sqrt(n-k^2) ]. - Liouville (?)
%F A057655 a(n) - Pi*n = O(sqrt(n)) (Gauss). a(n) - Pi*n = O(n^c), c = 23/73 + epsilon ~ 0.3151 (Huxley). If a(n) - Pi*n = O(n^c) then c > 1/4 (Landau, Hardy). It is conjectured that a(n) - Pi*n = O(n^(1/4 + epsilon)) for all epsilon > 0.
%F A057655 a(n) = A014198(n) + 1.
%F A057655 a(n) = A122510(2,n). - _R. J. Mathar_, Apr 21 2010
%F A057655 a(n) = 1 + sum((floor(1/(k+1)) + 4 * floor(cos(Pi * sqrt(k))^2) - 4 * floor(cos(Pi * sqrt(k/2))^2) + 8 * sum((floor(cos(Pi * sqrt(i))^2) * floor(cos(Pi * sqrt(k-i))^2)), i = 1..floor(k/2))), k = 1..n). - _Wesley Ivan Hurt_, Jan 10 2013
%F A057655 G.f.: theta_3(0,x)^2/(1-x) where theta_3 is a Jacobi theta function. - _Robert Israel_, Sep 29 2014
%e A057655 a(0) = 1 (counting origin).
%e A057655 a(1) = 5 since 4 points lie on the circle of radius sqrt(1) + origin.
%e A057655 a(2) = 9 since 4 lattice points lie on the circle w/radius = sqrt(2) (along diagonals) + 4 points inside the circle + origin. - _Wesley Ivan Hurt_, Jan 10 2013
%p A057655 N:= 1000: # to get a(0) to a(N)
%p A057655 R:= Array(0..N):
%p A057655 for a from 0 to floor(sqrt(N)) do
%p A057655 for b from 0 to floor(sqrt(N-a^2)) do
%p A057655 r:= a^2 + b^2;
%p A057655 R[r]:= R[r] + (2 - charfcn[0](a))*(2 - charfcn[0](b));
%p A057655 od
%p A057655 od:
%p A057655 convert(map(round,Statistics:-CumulativeSum(R)),list); # _Robert Israel_, Sep 29 2014
%t A057655 f[n_] := 1 + 4Sum[ Floor@ Sqrt[n - k^2], {k, 0, Sqrt[n]}]; Table[ f[n], {n, 0, 60}] (* _Robert G. Wilson v_, Jun 16 2006 *)
%t A057655 Accumulate[ SquaresR[2, Range[0, 55]]] (* _Jean-François Alcover_, Feb 24 2012 *)
%t A057655 CoefficientList[Series[EllipticTheta[3,0,x]^2/(1-x), {x, 0, 100}], x] (* _Vaclav Kotesovec_, Sep 29 2014 after _Robert Israel_ *)
%o A057655 (PARI) a(n)=sum(x=-n,n,sum(y=-n,n,if((sign(x^2+y^2-n)+1)*sign(x^2+y^2-n),0,1)))
%o A057655 (PARI) a(n)=1+4*sum(k=0,sqrtint(n), sqrtint(n-k^2) ); /* _Benoit Cloitre_, Oct 08 2012 */
%o A057655 (Haskell)
%o A057655 a057655 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n]
%o A057655 -- _Reinhard Zumkeller_, Jan 23 2012
%o A057655 (Python)
%o A057655 from math import isqrt
%o A057655 def A057655(n): return 1+(sum(isqrt(n-k**2) for k in range(isqrt(n)+1))<<2) # _Chai Wah Wu_, Jul 31 2023
%Y A057655 Partial sums of A004018. Cf. A014198, A057656, A057961, A057962, A122510. For another version see A000328.
%Y A057655 Cf. A038589 (for hexagonal lattice).
%K A057655 nonn,easy,nice
%O A057655 0,2
%A A057655 _N. J. A. Sloane_, Oct 15 2000
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE