OFFSET
1,2
LINKS
David Dewan, Table of n, a(n) for n = 1..10000
David Dewan, Drawings for n=1..12
FORMULA
a(n) = 2*Sum_{k=1..n-1} floor(2*sqrt(n^2 - (k+1/2)^2)) + 2*n - 1.
EXAMPLE
a(2)=7 since you cannot pack more than 7 unit-side squares in a disk of radius 2
MATHEMATICA
f[n_] := 2 Sum[ IntegerPart[2 Sqrt[n^2 - (n - k - 1/2)^2]], {k, 0, n - 2}] + IntegerPart[2 Sqrt[n^2 - 1/2^2]]; Array[f, 47] (* Robert G. Wilson v, Jan 27 2007 *)
a[n_]:=2 Sum[Floor[2 Sqrt[n^2-(k+1/2)^2]], {k, n-1}]+2n-1;
Array[a, 47] (* David Dewan, Jun 07 2024*)
PROG
(Python)
from math import isqrt
def A125228(n): return (m:=n<<1)-1+(sum(isqrt((k*(m-k+1)-n<<2)-1) for k in range(1, n))<<1) # Chai Wah Wu, Jul 18 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Filippo ALUFFI PENTINI (falpen(AT)gmail.com), Jan 25 2007
EXTENSIONS
More terms from Robert G. Wilson v, Jan 27 2007
STATUS
approved