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.

A124623 Number of unit squares having center within inscribed circle of an n X n integer square.

Original entry on oeis.org

1, 4, 9, 12, 21, 32, 37, 52, 69, 80, 97, 112, 137, 156, 177, 208, 225, 256, 293, 316, 349, 384, 421, 448, 489, 540, 577, 616, 665, 716, 749, 812, 861, 912, 973, 1020, 1085, 1124, 1201, 1264, 1313, 1396, 1457, 1528, 1597, 1664, 1741, 1804, 1885, 1976, 2053, 2128
Offset: 1

Views

Author

William A. Berry (waberr2(AT)uky.edu), Dec 21 2006

Keywords

Comments

From Robert G. Wilson v, Mar 22 2017: (Start)
For n odd, the center of the circle is in the middle of the center square and thus a(2n-1) == 1 (mod 4).
For n even, the center of the circle is at the four corners of the center 4 squares and thus a(2n) == 0 (mod 4).
a(n) ~ n*Pi/4. (End)

Crossrefs

Cf. A051233.

Programs

  • Mathematica
    f[n_] := 4*Length[ Select[ Flatten[ Table[ If[ OddQ@ n, x^2 + y^2, x(x -1) + y(y -1) + 1/2], {x, n/2}, {y, n/2}]], 4# < n^2 &]] + If[ OddQ@ n, 2(n -1) + 1, 0]; Array[f, 52] (* Robert G. Wilson v, Mar 22 2017 *)

Formula

a(n) = n^2 - 4*k(n); k(n) = number of exterior centers per quadrant.
a(2n-1) = A036704(n-1). - Robert G. Wilson v, Mar 28 2017
a(2n) = 4*A120883(n-1). - Robert G. Wilson v, Mar 28 2017

A033551 Closest integer to (Pi/4)*n^2.

Original entry on oeis.org

1, 3, 7, 13, 20, 28, 38, 50, 64, 79, 95, 113, 133, 154, 177, 201, 227, 254, 284, 314, 346, 380, 415, 452, 491, 531, 573, 616, 661, 707, 755, 804, 855, 908, 962, 1018, 1075, 1134, 1195, 1257, 1320, 1385, 1452, 1521
Offset: 1

Views

Author

Joe K. Crump (joecr(AT)carolina.rr.com)

Keywords

Examples

			a(3)=7, since 3^2*Pi/4 = 7.06858347.
		

Crossrefs

Approximation for A051233.

Programs

  • GAP
    List([1..50], n-> Int(Round(Atan(1.0)*n^2)) ); # G. C. Greubel, Oct 12 2019
  • Magma
    R:= RealField(20); [Round(Pi(R)*n^2/4): n in [1..50]]; // G. C. Greubel, Oct 12 2019
    
  • Maple
    seq(round((1/4)*Pi*n^2), n = 1..50); # G. C. Greubel, Oct 12 2019
  • Mathematica
    Round[Pi/4 Range[50]^2] (* Harvey P. Dale, May 11 2016 *)
  • PARI
    a(n) = round((Pi/4) * n^2); \\ Michel Marcus, Sep 02 2013
    
  • Sage
    [round(pi*n^2/4) for n in (1..50)] # G. C. Greubel, Oct 12 2019
    

Formula

a(n) = round( (Pi/4) * n^2 ).
Showing 1-2 of 2 results.