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-5 of 5 results.

A372847 Number of unit squares enclosed by a circle of radius n with an even number of rows and the maximum number of squares in each row.

Original entry on oeis.org

0, 6, 18, 36, 64, 92, 130, 172, 224, 284, 344, 410, 488, 570, 658, 750, 852, 956, 1072, 1194, 1312, 1450, 1584, 1728, 1882, 2044, 2204, 2372, 2548, 2730, 2916, 3112, 3312, 3520, 3738, 3950, 4184, 4408, 4656, 4900, 5146, 5402, 5670, 5942, 6222, 6492, 6784, 7080, 7382, 7700
Offset: 1

Views

Author

David Dewan, May 14 2024

Keywords

Comments

Always has an even number of rows (2*n-2) and each row may have an odd or even number of squares.
Symmetrical about the horizontal and vertical axes.

Examples

			For n=4
row 1:   5 squares
row 2:   6 squares
row 3:   7 squares
row 4:   7 squares
row 5:   6 squares
row 6:   5 squares
Total = 36
		

Crossrefs

Cf. A136485 (by diameter), A001182 (within quadrant), A136483 (quadrant by diameter), A119677 (even number of rows with even number of squares in each), A125228 (odd number of rows with maximal squares per row), A341198 (points rather than squares).

Programs

  • Mathematica
    a[n_]:=2 Sum[Floor[2 Sqrt[n^2 - k^2]], {k,n-1}]; Array[a,50]

Formula

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

A373193 On a unit square grid, the number of squares enclosed by a circle of radius n with origin at the center of a square.

Original entry on oeis.org

1, 5, 21, 37, 61, 89, 129, 177, 221, 277, 341, 401, 489, 561, 657, 749, 845, 949, 1049, 1185, 1313, 1441, 1573, 1709, 1877, 2025, 2185, 2361, 2529, 2709, 2901, 3101, 3305, 3505, 3713, 3917, 4157, 4397, 4637, 4865, 5121, 5377, 5637, 5917, 6197, 6485, 6761
Offset: 1

Views

Author

David Dewan, May 27 2024

Keywords

Comments

This corresponds to a circle of radius n with center at 1/2,1/2 on a unit square grid.
Always has an odd number of rows (2 n - 1) with an odd number of squares in each row.
Symmetrical about the horizontal and vertical axes.

Examples

			For n=4:
  row 1: 3 squares   - - X X X - -
  row 2: 5 squares   - X X X X X -
  row 3: 7 squares   X X X X X X X
  row 4: 7 squares   X X X X X X X
  row 5: 7 squares   X X X X X X X
  row 6: 5 squares   - X X X X X -
  row 7: 3 squares   - - X X X - -
Total = 37 = a(4).
		

Crossrefs

Cf. A119677 (on unit square grid with circle center at origin), A372847 (even number of rows with maximal squares per row), A125228 (odd number of rows with maximal squares per row), A000328 (number of squares whose centers are inside the circle).

Programs

  • Mathematica
    Table[4*Sum[Floor[Sqrt[n^2-(k+1/2)^2]-1/2],{k,1,n-1}]+4*n-3,{n,50}]

Formula

a(n) = 4*Sum_{k=1..n-1} floor(sqrt(n^2 - (k+1/2)^2) - 1/2) + 4*n - 3.
a(n) == 1 (mod 4). - Robert FERREOL, Jan 31 2025

A386538 a(n) is the maximum possible area of a polygon within a circle of radius n, where both the center and the vertices lie on points of a unit square grid.

Original entry on oeis.org

0, 2, 8, 24, 42, 74, 104, 138, 186, 240, 304, 362, 424, 512, 594, 690, 776, 880, 986, 1104, 1232, 1346, 1490, 1624, 1762, 1930, 2088, 2256, 2418, 2594, 2784, 2962, 3170, 3368, 3584, 3810, 4008, 4248, 4466, 4730, 4976, 5210, 5474, 5736, 6024, 6306, 6570, 6864, 7154
Offset: 0

Views

Author

Felix Huber, Aug 05 2025

Keywords

Comments

a(n) > 99% of the circle area for n >= 50.
Conjecture: The maximum possible area of a polygon within the circle would be the same if only the vertices but not the center were fixed on grid points.
All terms are even.

Examples

			See linked illustration of the term a(4) = 42.
		

Crossrefs

Programs

  • Maple
    A386538:=proc(n)
        local x,y,p,s;
        p:=4*n;
        s:={};
        for x to n do
            y:=floor(sqrt(n^2-x^2));
            p:=p+4*y;
            s:=s union {y}
        od;
        return p-2*nops(s)
    end proc;
    seq(A386538(n),n=0..48);
  • Mathematica
    a[n_] := Module[{p=4n},s = {}; Do[ y = Floor[Sqrt[n^2 - x^2]];p = p + 4*y;s = Union[s, {y}],{x,n} ];p - 2*Length[s]];Array[a,49,0] (* James C. McMahon, Aug 19 2025 *)

Formula

a(n) = A386539(A000217(n)) = A386539(n,n) for n >= 1.
a(n) <= A066643(n).

A108126 Maximal number of squares of side 1 in an ellipse of semiaxes n,2n.

Original entry on oeis.org

3, 17, 43, 83, 137, 203, 279, 369, 471, 587, 715, 857, 1011, 1175, 1351, 1541, 1743, 1961, 2191, 2429, 2683, 2949, 3227, 3523, 3829, 4137, 4469, 4809, 5167, 5539, 5913, 6295, 6701, 7127, 7555, 7999, 8449, 8909, 9395, 9889, 10395, 10915
Offset: 1

Views

Author

Pasquale CUTOLO (p.cutolo(AT)inwind.it), Jun 14 2007

Keywords

Examples

			a(1)=3 since you cannot pack more than 3 unit-side squares in an ellipse of semiaxes 1,2
		

Crossrefs

Similar to A125228.

Programs

  • Mathematica
    f[n_] := 2 Sum[IntegerPart[2 Sqrt[4 n^2 - (h - 1/2)^2]],
    {h, 2, 2 n}] + IntegerPart[2 Sqrt[4 n^2 - 1/4]]; Array[f,42]

A373008 Radii r of circles that can enclose more unit squares when having fewer rows of squares: 2*r - 2 rows instead of 2*r - 1 rows.

Original entry on oeis.org

19, 52, 65, 184, 197, 222, 230, 303, 328, 341, 425, 489, 646, 985, 1018, 1328, 1383, 1400, 1637, 1743, 1806, 1870, 1938, 1997, 2060, 2065, 2179, 2192, 2433, 2603, 2610, 2611, 2675, 2692, 2747, 2895, 2925, 2975, 3008, 3107, 3254, 3446, 3462, 3619, 3635
Offset: 1

Views

Author

David Dewan, May 19 2024

Keywords

Comments

Numbers r for which A372847(r) > A125228(r).
For circles with these radii, a smaller number of rows (2*r - 2) allows more efficient packing than a larger number of rows (2*r - 1).

Examples

			Radius     2*r-2 rows         2*r-1 rows
19          1072 squares       1071 squares
52          8332 squares       8331 squares
65         13076 squares      13073 squares
		

Crossrefs

Cf. A125228 (odd number of rows with maximum squares per row), A372847 (even number of rows with maximum squares per row).

Programs

  • Mathematica
    lessRows[r_] := 2 Sum[Floor[2 Sqrt[r^2 - k^2]], {k, r - 1}]
    moreRows[r_] := 2 Sum[Floor[2 Sqrt[r^2 - (k + 1/2)^2]], {k, r - 1}] + 2 r - 1
    Select[Range@100,lessRows[#] > moreRows[#] &]

Formula

{ r : 2*Sum_{k=1..r-1} floor(2*sqrt(r^2 - k^2)) > 2*Sum_{k=1..r-1} floor(2*sqrt(r^2 - (k+1/2)^2)) + 2*r - 1 }.
Showing 1-5 of 5 results.