A119677
a(n) is the number of complete squares that fit inside the circle with radius n, drawn on squared paper at (0, 0).
Original entry on oeis.org
0, 0, 4, 16, 32, 60, 88, 120, 164, 216, 276, 332, 392, 476, 556, 648, 732, 832, 936, 1052, 1176, 1288, 1428, 1560, 1696, 1860, 2016, 2180, 2340, 2512, 2700, 2876, 3080, 3276, 3488, 3712, 3908, 4144, 4360, 4620, 4864, 5096, 5356, 5616, 5900
Offset: 0
Tomas Kyselica (Tomas.Kyselica(AT)gmail.com), Jul 29 2006
-
a[n_] := 4 Sum[Floor[Sqrt[n^2 - k^2]], {k, n - 1}];
Array[a, 45, 0] (* David Dewan, May 27 2024 *)
-
from math import isqrt
def A119677(n): return sum(isqrt(k*((n<<1)-k)) for k in range(1,n))<<2 # Chai Wah Wu, Jul 18 2024
A136483
Number of unit square lattice cells inside quadrant of origin-centered circle of diameter n.
Original entry on oeis.org
0, 0, 1, 1, 3, 4, 6, 8, 13, 15, 19, 22, 28, 30, 37, 41, 48, 54, 64, 69, 77, 83, 94, 98, 110, 119, 131, 139, 152, 162, 172, 183, 199, 208, 226, 234, 253, 263, 281, 294, 308, 322, 343, 357, 377, 390, 412, 424, 447, 465, 488, 504, 528, 545, 567, 585, 612, 628, 654
Offset: 1
Glenn C. Foster (gfoster(AT)uiuc.edu), Jan 02 2008
a(5) = 3 because a circle of radius 5/2 in the first quadrant encloses (2,1), (1,1), (1,2).
-
A136483:= func< n | n eq 1 select 0 else (&+[Floor(Sqrt((n/2)^2-j^2)): j in [1..Floor(n/2)]]) >;
[A136483(n): n in [1..100]]; // G. C. Greubel, Jul 28 2023
-
Table[Sum[Floor[Sqrt[(n/2)^2 -k^2]], {k,Floor[n/2]}], {n,100}]
-
a(n) = sum(k=1, n\2, sqrtint((n/2)^2 - k^2)); \\ Michel Marcus, Jul 28 2023
-
def A136483(n): return sum(isqrt((n/2)^2-j^2) for j in range(1,(n//2)+1))
[A136483(n) for n in range(1,101)] # G. C. Greubel, Jul 28 2023
A228232
Number of strict Gaussian primes of norm less than or equal to n in the first quadrant.
Original entry on oeis.org
0, 1, 3, 5, 7, 9, 13, 17, 19, 23, 29, 31, 35, 41, 43, 49, 57, 63, 69, 75, 83, 89, 93, 99, 109, 117, 123, 133, 141, 149, 157, 167, 175, 187, 197, 207, 215, 225, 233, 239, 253, 267, 273, 287, 297, 309, 319, 335, 351, 361, 369, 385, 403, 415, 425, 439, 453, 465, 481, 495
Offset: 1
Cf.
A001182 (number of strict Gaussian integers in the first quadrant).
Cf.
A062711 (counts the Gaussian primes on axes also).
Cf.
A228233 (version of this sequence including the axes).
-
nn = 60; t = Select[Flatten[Table[a + b*I, {a, nn}, {b, nn}]], PrimeQ[#, GaussianIntegers -> True] &]; Table[Length[Select[t, Abs[#] <= n &]], {n, nn}] (* T. D. Noe, Aug 19 2013 *)
A136514
Number of unit square lattice cells inside half-plane (two adjacent quadrants) of origin centered circle of radius n.
Original entry on oeis.org
0, 2, 8, 16, 30, 44, 60, 82, 108, 138, 166, 196, 238, 278, 324, 366, 416, 468, 526, 588, 644, 714, 780, 848, 930, 1008, 1090, 1170, 1256, 1350, 1438, 1540, 1638, 1744, 1856, 1954, 2072, 2180, 2310, 2432, 2548, 2678, 2808, 2950, 3090, 3220, 3366, 3510, 3664
Offset: 1
Glenn C. Foster (gfoster(AT)uiuc.edu), Jan 02 2008
a(2) = 2 because a circle centered at the origin and of radius 2 encloses (-1,1) and (1,1) in the upper half plane.
-
A136514:= func< n | n eq 1 select 0 else 2*(&+[Floor(Sqrt(n^2-j^2)): j in [1..n-1]]) >;
[A136514(n): n in [1..100]]; // G. C. Greubel, Jul 27 2023
-
Table[2*Sum[Floor[Sqrt[n^2 -k^2]], {k,n-1}], {n,100}]
-
a(n) = 2*sum(k=1, n-1, sqrtint(n^2-k^2)); \\ Michel Marcus, Jul 27 2023
-
def A136514(n): return 2*sum(isqrt(n^2-k^2) for k in range(1,n))
[A136514(n) for n in range(1,101)] # G. C. Greubel, Jul 27 2023
A281795
Number of unit squares (partially) covered by a disk of radius n centered at the origin.
Original entry on oeis.org
0, 4, 16, 36, 60, 88, 132, 172, 224, 284, 344, 416, 484, 568, 664, 756, 856, 956, 1076, 1200, 1324, 1452, 1600, 1740, 1884, 2040, 2212, 2392, 2560, 2732, 2928, 3120, 3332, 3536, 3748, 3980, 4192, 4428, 4660, 4920, 5172, 5412, 5688, 5956, 6248, 6528, 6804, 7104, 7400, 7716
Offset: 0
a(4) = 4 * 15 = 60 because in the positive quadrant 15 unit squares are covered and the problem is symmetrical. In the bounding box of the circle only the unit squares in the corners are not (partially) covered, so a(4) = 8*8 - 4 = 60.
-
N:= 100: # for a(0)..a(N)
V:=Array(0..N):
for i from 0 to N do
for j from 0 to i do
r:= sqrt(i^2 + j^2);
if r::integer then r:= r+1 else r:= ceil(r) fi;
if r > N then break fi;
if i=j then m:= 4 else m:= 8 fi;
V[r..N]:= V[r..N] +~ m;
od od:
convert(V,list); # Robert Israel, Feb 21 2025
-
A281795[n_] := 4*Sum[Ceiling[Sqrt[n^2 - k^2]], {k, 0, n-1}];
Array[A281795, 100, 0] (* Paolo Xausa, Feb 21 2025 *)
-
a = @(n) 4*sum(ceil(sqrt(n.^2-(0:n-1).^2))); % Luis Mendo, Aug 09 2021
-
a = lambda n: sum(4 for x in range(n) for y in range(n)
if x*x + y*y < n*n)
A349609
Number of solutions to x^2 + y^2 <= n^2, where x, y are positive odd integers.
Original entry on oeis.org
0, 0, 1, 1, 3, 4, 8, 8, 13, 15, 20, 22, 28, 31, 39, 43, 52, 54, 64, 69, 79, 83, 96, 102, 112, 121, 135, 140, 154, 162, 179, 185, 203, 212, 228, 238, 255, 265, 281, 296, 316, 326, 349, 359, 382, 394, 416, 429, 451, 469, 494, 508, 532, 547, 573, 587
Offset: 0
a(4) = 3 since there are solutions (1,1), (3,1), (1,3).
-
Table[SeriesCoefficient[EllipticTheta[2, 0, x^4]^2/(4 (1 - x)), {x, 0, n^2}], {n, 0, 55}]
A372847
Number of unit squares enclosed by a circle of radius n with an even number of rows and the maximum number of squares in each row.
Original entry on oeis.org
0, 6, 18, 36, 64, 92, 130, 172, 224, 284, 344, 410, 488, 570, 658, 750, 852, 956, 1072, 1194, 1312, 1450, 1584, 1728, 1882, 2044, 2204, 2372, 2548, 2730, 2916, 3112, 3312, 3520, 3738, 3950, 4184, 4408, 4656, 4900, 5146, 5402, 5670, 5942, 6222, 6492, 6784, 7080, 7382, 7700
Offset: 1
For n=4
row 1: 5 squares
row 2: 6 squares
row 3: 7 squares
row 4: 7 squares
row 5: 6 squares
row 6: 5 squares
Total = 36
Cf.
A136485 (by diameter),
A001182 (within quadrant),
A136483 (quadrant by diameter),
A119677 (even number of rows with even number of squares in each),
A125228 (odd number of rows with maximal squares per row),
A341198 (points rather than squares).
A120883
(1/4)*number of lattice points with odd indices in a square lattice inside a circle around the origin with radius 2*n.
Original entry on oeis.org
0, 1, 3, 8, 13, 20, 28, 39, 52, 64, 79, 96, 112, 135, 154, 179, 203, 228, 255, 281, 316, 349, 382, 416, 451, 494, 532, 573, 618, 661, 707, 756, 807, 859, 910, 963, 1015, 1076, 1137, 1198, 1256, 1321, 1386, 1452, 1523, 1594, 1667, 1737, 1808, 1889, 1965, 2046, 2123
Offset: 0
a(3)=8 because the 8 lattice points in the first quadrant (x,y) = {(1,1), (1,3), (3,1), (1,5), (5,1), (3,3), (3,5), (5,3)} all satisfy x^2 + y^2 < (2*3)^2.
a(3)=8 because (1/2,1/2), (1/2,3/2), (1/2,5/2), (3/2,1/2), (3/2,3/2), (3/2,5/2), (5/2,1/2) and (5/2,3/2) all satisfy x^2 + y^2 <= n^2. - _Jon Perry_, Nov 04 2012
A097689
Number of prime pairs (p,q) with p^2 + q^2 <= n^2.
Original entry on oeis.org
0, 0, 1, 3, 4, 8, 8, 13, 15, 16, 16, 20, 22, 30, 32, 33, 33, 41, 44, 50, 54, 58, 58, 66, 69, 73, 76, 76, 78, 88, 88, 100, 103, 107, 109, 111, 113, 123, 127, 129, 131, 142, 146, 159, 165, 167, 169, 183, 191, 193, 197, 201, 204, 214, 218, 224, 230, 233, 233, 245, 252, 268
Offset: 1
-
a[n_] := a[n] = Module[{cnt = 0, p, q}, Do[p = Prime[ip]; q = Prime[iq]; If[p^2 + q^2 <= n^2, If[p == q, cnt++, If[p < q, cnt += 2, 0]]], {ip, PrimePi[n]}, {iq, ip, PrimePi[n]}]; cnt];
Array[a, 100] (* Jean-François Alcover, Nov 18 2021 *)
Comments