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

A302829 a(n) is the number of lattice points in a Cartesian grid between a circle of radius n and an inscribed square whose vertices lie on the coordinate axes.

Original entry on oeis.org

0, 0, 4, 8, 12, 28, 36, 52, 72, 88, 112, 128, 156, 192, 220, 252, 280, 324, 368, 408, 448, 504, 548, 592, 644, 708, 776, 828, 880, 952, 1016, 1096, 1164, 1236, 1324, 1388, 1472, 1548, 1648, 1736, 1808, 1912, 2004, 2116, 2212, 2300, 2408, 2508, 2624, 2728, 2860, 2976, 3076
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 27 2018

Keywords

Comments

Points are not lying on the borders of the circle and the square.
Note that if the square is rotated so that its sides are parallel to the coordinate axes, the resulting sequence is A303642 instead.

Crossrefs

Programs

  • PARI
    a(n) = sum(x=-n, +n, sum(y=-n, +n, ((x^2+y^2) < n^2) && ((abs(x)+abs(y))^2 > n^2))); \\ Michel Marcus, May 22 2018
  • Python
    for n in range (1, 100):
        count=0
        for x in range (0, n):
            for y in range (0, n):
                if (x*x+y*yn):
                    count=count+1
        print(4*count)
    

Formula

a(n) = A281795(n) - 4*A034856(n). - Andrey Zabolotskiy, Apr 29 2018

A303644 a(n) is the number of lattice points in a Cartesian grid between a square of side length 2*n, centered at the origin, and its inscribed circle. The sides of the square are parallel to the coordinate axes.

Original entry on oeis.org

0, 0, 0, 4, 4, 12, 24, 32, 40, 48, 68, 92, 100, 120, 136, 168, 192, 220, 244, 268, 312, 336, 376, 420, 444, 484, 524, 576, 624, 664, 724, 764, 820, 868, 912, 992, 1040, 1116, 1156, 1220, 1304, 1368, 1440, 1496, 1564, 1660, 1732, 1816, 1888, 1960, 2032, 2116, 2220, 2308
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 27 2018

Keywords

Comments

The borders of the square and the circle are not included. Rotating the square by 45 degrees (so that its vertices lie on the coordinate axes) results in sequence A303646 instead.

Examples

			For n = 4, we have 4 points with integer coordinates; the point in the first quadrant is at (3,3):
.
                    o . . + . . o
                    . . . + . . .
                    . . . + . . .
                   -+-+-+-+-+-+-+-
                    . . . + . . .
                    . . . + . . .
                    o . . + . . o
.
Similarly, for n = 5, we have 4 points with integer coordinates; the point in the first quadrant is at (4,4):
.
                  o . . . + . . . o
                  . . . . + . . . .
                  . . . . + . . . .
                  . . . . + . . . .
                 -+-+-+-+-+-+-+-+-+-
                  . . . . + . . . .
                  . . . . + . . . .
                  . . . . + . . . .
                  o . . . + . . . o
.
For n = 6, we have 12 points, of which the 3 points in the first quadrant are at (4,5), (5,4), and (5,5):
.
                o o . . . + . . . o o
                o . . . . + . . . . o
                . . . . . + . . . . .
                . . . . . + . . . . .
                . . . . . + . . . . .
               -+-+-+-+-+-+-+-+-+-+-+-
                . . . . . + . . . . .
                . . . . . + . . . . .
                . . . . . + . . . . .
                o . . . . + . . . . o
                o o . . . + . . . o o
		

Crossrefs

Programs

  • PARI
    a(n) = sum(x=-n+1, n-1, sum(y=-n+1, n-1, (x^2+y^2) > n^2)); \\ Michel Marcus, May 22 2018
  • Python
    import math
    for n in range(1, 100):
        count = 0
        for x in range(1, n):
            for y in range(1, n):
                if x * x + y * y > n * n and x < n and y < n:
                    count = count + 1
        print(4 * count, end=", ")
    

Formula

a(n) = A016754(n-1) - A000328(n) - 4.

A303646 a(n) is the number of lattice points in a Cartesian grid between a square with integer sides 2*n and its inscribed circle. The sides of the square are parallel to the bisector of coordinate axes.

Original entry on oeis.org

0, 0, 12, 12, 32, 32, 32, 68, 60, 104, 104, 104, 156, 148, 216, 216, 300, 292, 276, 368, 368, 468, 460, 452, 560, 544, 676, 668, 816, 792, 784, 932, 916, 1080, 1048, 1048, 1220, 1212, 1384, 1360, 1352, 1556, 1532, 1736, 1704, 1956, 1924, 1900, 2136, 2096, 2340, 2308
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 27 2018

Keywords

Comments

Rotating the square by 45 degrees (so that its vertices lie on the coordinate axes) results in sequence A303644 instead.

Crossrefs

Programs

  • PARI
    a(n) = sum(x=-2*n, 2*n, sum(y=-2*n, 2*n, ((x^2+y^2) > n^2) && ((abs(x)+abs(y))^2 < 2*n^2))); \\ Michel Marcus, May 22 2018
  • Python
    import math
    for n in range (1, 100):
       sqn = math.ceil(math.sqrt(2)*n)
       count = 0
       for x in range(-sqn, sqn):
           for y in range(-sqn, sqn):
               if (x*x+y*y>n*n and abs(x)+abs(y)
    				

A303669 a(n) is the number of lattice points in a Cartesian grid between a circle of radius n, centered at the origin, and an inscribed equilateral triangle; one of the sides of triangle is perpendicular to X-axis.

Original entry on oeis.org

0, 2, 13, 21, 36, 56, 81, 103, 144, 166, 215, 239, 298, 342, 405, 447, 514, 568, 655, 707, 796, 864, 961, 1019, 1128, 1208, 1337, 1405, 1524, 1614, 1749, 1847, 1990, 2082, 2249, 2333, 2502, 2600, 2789, 2899, 3064, 3192, 3383, 3519, 3718, 3832, 4047, 4175
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 28 2018

Keywords

Examples

			For n = 2 we have two lattice points between the defined circle and its inscribed equilateral triangle: (1, 1) and (1, -1).
		

Crossrefs

Programs

  • PARI
    a(n) = sum(x=-n, +n, sum(y=-n, +n, ((x^2+y^2) < n^2) && ((2*x < - n) || (3*y^2 > (n-x)^2)))); \\ Michel Marcus, May 22 2018
  • Python
    import math
    tan=math.sqrt(3)/3
    for n in range (1,70):
     count=0
     count1=0
     for x in range (-n, n):
      for y in range (-n,n):
       if (x*x+y*y-tan*x+tan*n):
        count=count+1
       if (x*x+y*y
    				

A303743 a(n) is a number of lattice points in 3D Cartesian grid between cube with edge length 2*n centered in origin and its inscribed sphere. Three pairs of the cube's faces are parallel to the planes XOY, XOZ, YOZ respectively.

Original entry on oeis.org

0, 0, 8, 92, 220, 412, 784, 1272, 1848, 2696, 3692, 5020, 6460, 8176, 10248, 12720, 15464, 18476, 21988, 25924, 30016, 35040, 40248, 46052, 52388, 59132, 66364, 74416, 83256, 92304, 102500, 112988, 124076, 136252, 148936, 162648, 176928, 192332, 208100, 225284, 243088
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 29 2018

Keywords

Comments

If two parallel faces of the inscribed cube are parallel XOY-plane and other two pairs are parallel planes x=y and x=-y respectively we'll have another sequence.

Examples

			For n=3 we have 8 points between the defined cube and its inscribed sphere:
  (-2,-2,-2)
  (-2,-2, 2)
  (-2, 2,-2)
  (-2, 2, 2)
  ( 2,-2,-2)
  ( 2,-2, 2)
  ( 2, 2,-2)
  ( 2, 2, 2)
		

Crossrefs

For the 2D case see A303642.

Programs

  • PARI
    a(n) = sum(x=-n+1, n-1, sum(y=-n+1, n-1, sum(z=-n+1, n-1, x*x+y*y+z*z>n^2))); \\ Michel Marcus, Jun 23 2018
  • Python
    for n in range (1, 42):
      count=0
      n2 = n*n
      for x in range(-n+1, n):
        for y in range(-n+1, n):
          for z in range(-n+1, n):
            if x*x+y*y+z*z > n2:
              count += 1
      print(count)
    

Formula

a(n) = A016755(n-1) - A000605(n) - 6.

A304035 a(n) is the number of lattice points inside a square bounded by the lines x=-n/sqrt(2), x=n/sqrt(2), y=-n/sqrt(2), y=n/sqrt(2).

Original entry on oeis.org

1, 9, 25, 25, 49, 81, 81, 121, 169, 225, 225, 289, 361, 361, 441, 529, 625, 625, 729, 841, 841, 961, 1089, 1089, 1225, 1369, 1521, 1521, 1681, 1849, 1849, 2025, 2209, 2401, 2401, 2601, 2809, 2809, 3025, 3249, 3249, 3481, 3721, 3969, 3969, 4225, 4489, 4489, 4761, 5041, 5329, 5329, 5625, 5929, 5929
Offset: 1

Views

Author

Kirill Ustyantsev, May 05 2018

Keywords

Comments

If we calculate the first difference of this sequence and then substitute nonzero numbers as 1, we get exactly A080764.
If we include boundary points of the squares we get same sequence (obviously).
Duplicates appear at 4, 7, 11, 14, 18, 21, 24, 28, 31, 35, 38, 41, 45, 48, 52, 55 (= A083051 ?). - Robert G. Wilson v, Jun 20 2018

Crossrefs

Programs

  • PARI
    a(n) = sum(x=-n, n, sum(y=-n, n, ((2*x^2 < n^2) && (2*y^2 < n^2)))); \\ Michel Marcus, May 22 2018
  • Python
    import math
    for n in range (1, 100):
     count=0
     for x in range (-n, n):
      for y in range (-n, n):
       if ((2*x*x < n*n) and (2*y*y < n*n)):
        count=count+1
     print(count)
    

Formula

a(n) = A051132(n) - A303642(n).
Showing 1-6 of 6 results.