login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A136485
Number of unit square lattice cells enclosed by origin centered circle of diameter n.
5
0, 0, 4, 4, 12, 16, 24, 32, 52, 60, 76, 88, 112, 120, 148, 164, 192, 216, 256, 276, 308, 332, 376, 392, 440, 476, 524, 556, 608, 648, 688, 732, 796, 832, 904, 936, 1012, 1052, 1124, 1176, 1232, 1288, 1372, 1428, 1508, 1560, 1648, 1696, 1788, 1860, 1952, 2016
OFFSET
1,3
COMMENTS
a(n) is the number of complete squares that fit inside the circle with diameter n, drawn on squared paper.
LINKS
FORMULA
a(n) = 4 * Sum_{k=1..floor(n/2)} floor(sqrt((n/2)^2 - k^2)).
a(n) = 4 * A136483(n).
a(n) = 2 * A136513(n).
Lim_{n -> oo} a(n)/(n^2) -> Pi/4 (A003881).
a(n) = [x^(n^2)] (theta_3(x^4) - 1)^2 / (1 - x). - Ilya Gutkovskiy, Nov 24 2021
EXAMPLE
a(3) = 4 because a circle centered at the origin and of radius 3/2 encloses (-1,-1), (-1,1), (1,-1), (1,1).
MATHEMATICA
Table[4*Sum[Floor[Sqrt[(n/2)^2 - k^2]], {k, Floor[n/2]}], {n, 100}]
PROG
(Magma)
A136485:= func< n | n le 1 select 0 else 4*(&+[Floor(Sqrt((n/2)^2-j^2)): j in [1..Floor(n/2)]]) >;
[A136485(n): n in [1..100]]; // G. C. Greubel, Jul 29 2023
(SageMath)
def A136485(n): return 4*sum(floor(sqrt((n/2)^2-k^2)) for k in range(1, (n//2)+1))
[A136485(n) for n in range(1, 101)] # G. C. Greubel, Jul 29 2023
CROSSREFS
Alternating merge of A119677 of A136485.
Sequence in context: A282503 A323189 A121189 * A157617 A053415 A303315
KEYWORD
easy,nonn
AUTHOR
Glenn C. Foster (gfoster(AT)uiuc.edu), Jan 02 2008
STATUS
approved