OFFSET
0,3
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1000
Jianqiang Zhao, The Largest Circle Enclosing n Lattice Points, arXiv:2505.06234 [math.GM], 2025. See p. 18.
FORMULA
Limit_{n->oo} a(n)/n^2 = Pi. - Chai Wah Wu, Feb 12 2025
a(n) = 4*n - 3 + 4 Sum_{i=1..n-1} ceiling(sqrt(n^2 - i^2)) - 1, for n > 0 (see Zhao). - Giorgos Kalogeropoulos, May 20 2025
EXAMPLE
a(3)=25 from the points of shapes 00 (1), 10 (4), 11 (4), 20 (4), 21 (8), 22 (4).
MATHEMATICA
Table[Sum[SquaresR[2, k], {k, 0, n^2 - 1}], {n, 0, 46}]
a[0]=0; a[n_]:=4*n-3+4Sum[Ceiling[Sqrt[n^2-i^2]]-1, {i, n-1}]; Array[a, 47, 0] (* Giorgos Kalogeropoulos, May 20 2025 *)
PROG
(Haskell)
a051132 n = length [(x, y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 < n^2]
-- Reinhard Zumkeller, Jan 23 2012
(Python)
from math import isqrt
def A051132(n): return 1+(sum(isqrt(k*((n<<1)-k)-1) for k in range(1, n+1))<<2) if n else 0 # Chai Wah Wu, Feb 12 2025
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
Jostein Trondal (jostein.trondal(AT)protech.no)
EXTENSIONS
More terms from James Sellers
STATUS
approved
