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.

A125228 Maximal number of squares of side 1 in a disk of radius n.

This page as a plain text file.
%I A125228 #18 Jul 19 2024 14:31:00
%S A125228 1,7,21,39,65,93,135,179,227,285,349,415,495,573,663,759,859,963,1071,
%T A125228 1199,1325,1457,1591,1735,1891,2049,2207,2383,2557,2735,2929,3123,
%U A125228 3327,3529,3739,3955,4191,4427,4665,4901,5159,5413,5681,5951,6231,6515,6799
%N A125228 Maximal number of squares of side 1 in a disk of radius n.
%H A125228 David Dewan, <a href="/A125228/b125228.txt">Table of n, a(n) for n = 1..10000</a>
%H A125228 David Dewan, <a href="/A125228/a125228.pdf">Drawings for n=1..12</a>
%F A125228 a(n) = 2*Sum_{k=1..n-1} floor(2*sqrt(n^2 - (k+1/2)^2)) + 2*n - 1.
%e A125228 a(2)=7 since you cannot pack more than 7 unit-side squares in a disk of radius 2
%t A125228 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 *)
%t A125228 a[n_]:=2 Sum[Floor[2 Sqrt[n^2-(k+1/2)^2]],{k,n-1}]+2n-1;
%t A125228 Array[a, 47]  (*  _David Dewan_, Jun 07 2024*)
%o A125228 (Python)
%o A125228 from math import isqrt
%o A125228 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
%Y A125228 Similar to A001182 but less constrained.
%Y A125228 A124484 is another version.
%K A125228 easy,nonn
%O A125228 1,2
%A A125228 Filippo ALUFFI PENTINI (falpen(AT)gmail.com), Jan 25 2007
%E A125228 More terms from _Robert G. Wilson v_, Jan 27 2007