A136515 Number of unit square lattice cells inside half-plane (two adjacent quadrants) of origin centered circle of diameter 2n+1.
0, 2, 6, 12, 26, 38, 56, 74, 96, 128, 154, 188, 220, 262, 304, 344, 398, 452, 506, 562, 616, 686, 754, 824, 894, 976, 1056, 1134, 1224, 1308, 1406, 1500, 1592, 1694, 1804, 1914, 2026, 2136, 2258, 2374, 2504, 2626, 2756, 2892, 3022, 3164, 3300, 3450, 3600
Offset: 0
Examples
a(2) = 6 because a circle centered at the origin and of radius 2.5 encloses (-2,1),(-1,1),(-1,2),(2,1),(1,1),(1,2) in the upper half plane.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
Programs
-
Magma
A136515:= func< n | n eq 0 select 0 else 2*(&+[Floor(Sqrt((n+1/2)^2-j^2)): j in [1..n]]) >; [A136515(n): n in [0..100]]; // G. C. Greubel, Jul 27 2023
-
Mathematica
Table[2*Sum[Floor[Sqrt[(n +1/2)^2 -k^2]], {k,n}], {n,0,100}]
-
PARI
a(n) = 2*sum(k=1, n, sqrtint((n+1/2)^2-k^2)); \\ Michel Marcus, Jul 27 2023
-
SageMath
def A136515(n): return 2*sum(isqrt((n+1/2)^2-k^2) for k in range(1,n+1)) [A136515(n) for n in range(101)] # G. C. Greubel, Jul 27 2023
Comments