cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Views

Author

Glenn C. Foster (gfoster(AT)uiuc.edu), Jan 02 2008

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Magma
    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
    
  • Mathematica
    Table[2*Sum[Floor[Sqrt[n^2 -k^2]], {k,n-1}], {n,100}]
  • PARI
    a(n) = 2*sum(k=1, n-1, sqrtint(n^2-k^2)); \\ Michel Marcus, Jul 27 2023
  • SageMath
    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
    

Formula

Lim_{n -> oo} a(n)/(n^2) -> Pi/8.
a(n) = 2 * Sum_{k=1..n-1} floor(sqrt(n^2 - k^2)).
a(n) = A136513(2*n).
a(n) = 2*A001182(n). - R. J. Mathar, Jan 10 2008