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

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

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