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

A136485 Number of unit square lattice cells enclosed by origin centered circle of diameter n.

Original entry on oeis.org

0, 0, 4, 4, 12, 16, 24, 32, 52, 60, 76, 88, 112, 120, 148, 164, 192, 216, 256, 276, 308, 332, 376, 392, 440, 476, 524, 556, 608, 648, 688, 732, 796, 832, 904, 936, 1012, 1052, 1124, 1176, 1232, 1288, 1372, 1428, 1508, 1560, 1648, 1696, 1788, 1860, 1952, 2016
Offset: 1

Views

Author

Glenn C. Foster (gfoster(AT)uiuc.edu), Jan 02 2008

Keywords

Comments

a(n) is the number of complete squares that fit inside the circle with diameter n, drawn on squared paper.

Examples

			a(3) = 4 because a circle centered at the origin and of radius 3/2 encloses (-1,-1), (-1,1), (1,-1), (1,1).
		

Crossrefs

Alternating merge of A119677 of A136485.

Programs

  • Magma
    A136485:= func< n | n le 1 select 0 else 4*(&+[Floor(Sqrt((n/2)^2-j^2)): j in [1..Floor(n/2)]]) >;
    [A136485(n): n in [1..100]]; // G. C. Greubel, Jul 29 2023
    
  • Mathematica
    Table[4*Sum[Floor[Sqrt[(n/2)^2 - k^2]], {k,Floor[n/2]}], {n,100}]
  • SageMath
    def A136485(n): return 4*sum(floor(sqrt((n/2)^2-k^2)) for k in range(1,(n//2)+1))
    [A136485(n) for n in range(1,101)] # G. C. Greubel, Jul 29 2023

Formula

a(n) = 4 * Sum_{k=1..floor(n/2)} floor(sqrt((n/2)^2 - k^2)).
a(n) = 4 * A136483(n).
a(n) = 2 * A136513(n).
Lim_{n -> oo} a(n)/(n^2) -> Pi/4 (A003881).
a(n) = [x^(n^2)] (theta_3(x^4) - 1)^2 / (1 - x). - Ilya Gutkovskiy, Nov 24 2021

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

A374532 Number of complete unit squares that fit inside a circle of radius sqrt(n^2+1) centered at the origin of a square lattice.

Original entry on oeis.org

0, 4, 12, 24, 40, 68, 96, 132, 180, 224, 284, 340, 408, 492, 564, 656, 740, 848, 960, 1060, 1184, 1304, 1444, 1576, 1704, 1868, 2024, 2196, 2356, 2520, 2716, 2892, 3104, 3292, 3504, 3720, 3916, 4160, 4384, 4628, 4872, 5108, 5372, 5640, 5916, 6188, 6456, 6764, 7036
Offset: 0

Views

Author

Thomas Otten, Jul 10 2024

Keywords

Crossrefs

Cf. A119677 (case for radius of n), A237526.
Cf. A046092, A000328 (quadrant width 1 cell).

Programs

  • PARI
    a(n) = my(s=n^2+1); 4*sum(k=1, sqrtint(s), sqrtint(s-k^2)) \\ Andrew Howroyd, Jul 11 2024
    
  • Python
    def A374532(n): return sum(isqrt(k*((n<<1)-k)+1) for k in range(n))<<2 # Chai Wah Wu, Jul 18 2024

Formula

a(n) = 4*A237526(n^2 + 1).
Showing 1-4 of 4 results.