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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

1, 7, 21, 39, 65, 93, 135, 179, 227, 285, 349, 415, 495, 573, 663, 759, 859, 963, 1071, 1199, 1325, 1457, 1591, 1735, 1891, 2049, 2207, 2383, 2557, 2735, 2929, 3123, 3327, 3529, 3739, 3955, 4191, 4427, 4665, 4901, 5159, 5413, 5681, 5951, 6231, 6515, 6799
Offset: 1

Views

Author

Filippo ALUFFI PENTINI (falpen(AT)gmail.com), Jan 25 2007

Keywords

Examples

			a(2)=7 since you cannot pack more than 7 unit-side squares in a disk of radius 2
		

Crossrefs

Similar to A001182 but less constrained.
A124484 is another version.

Programs

  • 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*)
  • 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

Formula

a(n) = 2*Sum_{k=1..n-1} floor(2*sqrt(n^2 - (k+1/2)^2)) + 2*n - 1.

Extensions

More terms from Robert G. Wilson v, Jan 27 2007

A374505 Maximum number of unit squares aligned with unit-spaced horizontal lines that can be enclosed by a circle of diameter n.

Original entry on oeis.org

0, 0, 1, 4, 8, 14, 21, 29, 40, 52, 65, 81, 97, 116, 135, 156, 180, 203, 229, 258, 286, 317, 350, 383, 419, 455, 495, 536, 575, 620, 664, 711, 761, 808, 860, 916, 966, 1024, 1079, 1140, 1200, 1261, 1326, 1391, 1458, 1528, 1595, 1666, 1741, 1814, 1892, 1972
Offset: 0

Views

Author

David Dewan, Jul 09 2024

Keywords

Comments

It is conjectured that this construction gives the maximal number of axis-parallel unit squares that can be packed into a circle of diameter n.
From the Erich Friedman website the best known maximum number of unit squares enclosed by a circle of diameter n are for n >= 2: 1, 4, 8, 14, 21, 30, ... (this sequence has not been included in OEIS because the terms have not been proven optimal). The unit squares in this case are not required to be axis-parallel. However, the example of 30 axis-parallel squares enclosed in a circle of radius < 3.5 shows that if holes are allowed, better packings are possible than with the restricted case. - Andrew Howroyd, Jul 14 2024

Examples

			For a circle with diameter = 4:
With center of circle at y = 0 (on line between rows) it encloses 6 squares.
With center of circle at y = 2 - sqrt(3) ~= 0.268 it encloses 8 squares (maximal).
With center of circle at y = 1/2 (in middle of row) it encloses 7 squares.
So a(4) = 8.
		

Crossrefs

Cf. A124484, A256588 (unexpectedly similar).

Programs

  • Mathematica
    a[n_] := (
      distances = N[Map[Sqrt[n^2 - #^2]/2 &, Range[n - 1]]];
      topDeltas1 = Flatten[Map[# - distances &, Range[n/2]]];
      topDeltas2 = Select[topDeltas1, 0 < # <= .5 &];
      topDeltas3 = Map[{#, 1} &, topDeltas2];
      btmDeltas1 = Flatten[Map[distances - # &, Range[n/2]]];
      btmDeltas2 = Select[btmDeltas1, 0 <= # < .5 &];
      btmDeltas3 = Map[{#, -1} &, btmDeltas2];
      allDeltas4 = Join[topDeltas3, btmDeltas3, {{0, 0}}];
      allDeltas5 = SortBy[allDeltas4, {First, -Last[#] &}] ;
      cumulativeChanges = Accumulate[allDeltas5[[All, 2]]];
      startSqrs = 2 Sum[Floor[2 Sqrt[(n/2)^2 - k^2]], {k, n/2}];
      Return[startSqrs + Max[cumulativeChanges]]  )
    Map[a[#] &, Range[0, 51]]      (* this sequence *)
    Map[a[#] &, Range[0, 102, 2]]  (* A124484, by radius *)

Formula

a(2*n) <= A124484(n).

A374528 Conjectured number of unit squares setting a new density record when packed into the smallest possible enclosing circle.

Original entry on oeis.org

1, 6, 7, 10, 11, 12, 19, 21, 24, 26, 27
Offset: 1

Views

Author

Hugo Pfoertner, Jul 16 2024

Keywords

Comments

All data after 7 have to be considered as conjectural. The sequence is based on the configurations shown on Erich Friedman's "Squares in Circles" webpage, see link.

Crossrefs

Cf. A124484.
Showing 1-3 of 3 results.