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

A001182 Number of cells of square lattice of edge 1/n inside quadrant of unit circle centered at 0.

Original entry on oeis.org

0, 1, 4, 8, 15, 22, 30, 41, 54, 69, 83, 98, 119, 139, 162, 183, 208, 234, 263, 294, 322, 357, 390, 424, 465, 504, 545, 585, 628, 675, 719, 770, 819, 872, 928, 977, 1036, 1090, 1155, 1216, 1274, 1339, 1404, 1475, 1545, 1610, 1683, 1755, 1832, 1911, 1992, 2072
Offset: 1

Views

Author

Tihamer von Ghyczy (ghyczy(AT)esinet.net)

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Floor@ Sqrt[n^2 - k^2], {k, n - 1}], {n, 52}] (* Michael De Vlieger, Jan 30 2017 *)
  • Python
    from math import isqrt
    def A001182(n): return sum(isqrt(k*((n<<1)-k)) for k in range(1,n)) # Chai Wah Wu, Jul 18 2024

Formula

a(n) = Sum_{k=1..n-1} floor(sqrt(n^2-k^2)). - Horst Kraemer (horst.kraemer(AT)epost.de) Apr 07 2004
a(n) = A261849(2*n)/4 = (A281795(n)-A242118(n))/4. - Andrey Zabolotskiy, Jan 30 2017
a(n) = [x^(n^2)] (theta_3(x) - 1)^2/(4*(1 - x)), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018

Extensions

More terms from Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Jan 19 2000

A242394 Number of equilateral triangles (sides length = 1) that intersect the circumference of a circle of radius n centered at (0,0).

Original entry on oeis.org

6, 18, 30, 42, 54, 66, 66, 102, 114, 126, 138, 150, 150, 162, 198, 210, 222, 234, 222, 270, 258, 294, 306, 318, 330, 330, 366, 354, 390, 402, 390, 426, 450, 462, 450, 486, 474, 486, 510, 546, 558, 546, 558, 594, 606, 630, 642, 654, 618, 678, 690, 690, 726, 738, 750, 738, 750
Offset: 1

Views

Author

Kival Ngaokrajang, May 13 2014

Keywords

Comments

For all n, there are at least 6 points where the transit of circumference occurs exactly at the corners. The rare case is when the transit occurs at 2 corners of a triangle, i.e., at n = 1, 13, 181, 35113, ... , (A001570(n)). The pattern repeats itself at every Pi/3 sector along the circumference. The triangle count per half sector by rows can be arranged as an irregular triangle as shown in the illustration. The rows count (A242396) is equal to the case centered at (1/2,0), A242395.

Crossrefs

A242395 Number of equilateral triangles (sides length = 1) that intersect the circumference of a circle of radius n centered at (1/2,0).

Original entry on oeis.org

14, 26, 38, 58, 70, 82, 98, 110, 122, 142, 154, 166, 182, 194, 206, 218, 238, 250, 262, 278, 290, 302, 322, 334, 346, 362, 374, 386, 398, 418, 430, 442, 458, 470, 482, 502, 514, 526, 542, 554, 566, 578, 598, 610, 622, 638, 650, 662, 682, 694, 706, 722, 734, 746, 766, 778, 790
Offset: 1

Views

Author

Kival Ngaokrajang, May 13 2014

Keywords

Comments

For all n, it seems to be the case that transits of the circumference occurring exactly at the corners do not exist. The pattern repeats itself at a half circle. The triangle count in a quadrant by rows can be arranged as an irregular triangle as shown in the illustration. The rows count (A242396) is equal to the case centered at (0,0), A242394.

Crossrefs

Cf. A242118.

A261849 Number of squares in an n X n grid that are enclosed in a circle of diameter n (having the same center as the grid).

Original entry on oeis.org

0, 0, 1, 4, 9, 16, 21, 32, 45, 60, 69, 88, 101, 120, 145, 164, 185, 216, 241, 276, 293, 332, 365, 392, 437, 476, 509, 556, 593, 648, 681, 732, 785, 832, 885, 936, 989, 1052, 1109, 1176, 1225, 1288, 1353, 1428, 1489, 1560, 1625, 1696, 1781, 1860, 1933, 2016, 2085, 2180, 2241, 2340, 2425, 2512, 2609, 2700, 2793, 2876, 2973, 3080, 3173
Offset: 1

Views

Author

V.J. Pohjola, Sep 03 2015

Keywords

Comments

a(1)=0 by definition.
The idea behind the sequence was originally proposed at http://www.sanaristikot.net on Aug 19 2015 by Jaska Himberg.

Crossrefs

Programs

  • Mathematica
    c[n_, i_, j_] := Ceiling[Sqrt[(n - 2 i)^2 + (n - 2 j)^2]];
    t1[q_] := Take[q, 1]; t2[p_] := Take[p, -1]; p2[r_] := Power[r, 2];
    area = {}; (Do[
      a = {}; (Do[
        If[c[n, i, j] == n || c[n, i, j] == n - 1 || c[n, i, j] == n - 2,
         AppendTo[a, {i, j}]], {i, 1, Ceiling[n/2 (1 - Sqrt[2]/2)]}, {j, i,
         Floor[n/2]}]);
      b = (n - 2*Map[t2, Flatten[Map[t1, GatherBy[a, First]], 1]]);
      sum1 = 4*Apply[Plus, Drop[b, -1]]; sum2 = Map[p2, Last[b]];
      AppendTo[area, (sum1 + sum2)], {n, 2, 100}]);
    Flatten[{0, area}]
    a[1] = 0; a[n_] := If[EvenQ[n], 4 Sum[ Floor[ Sqrt[(n/2)^2 - k^2]], {k, n/2}], 4 Floor[n/2] - 3 + 4 Sum[Floor[-1/2 + Sqrt[(n/2)^2 - (k + 1/2)^2]], {k, n/2 - 1}]]; Array[a, 60] (* Giovanni Resta, Sep 10 2015 *)

A281795 Number of unit squares (partially) covered by a disk of radius n centered at the origin.

Original entry on oeis.org

0, 4, 16, 36, 60, 88, 132, 172, 224, 284, 344, 416, 484, 568, 664, 756, 856, 956, 1076, 1200, 1324, 1452, 1600, 1740, 1884, 2040, 2212, 2392, 2560, 2732, 2928, 3120, 3332, 3536, 3748, 3980, 4192, 4428, 4660, 4920, 5172, 5412, 5688, 5956, 6248, 6528, 6804, 7104, 7400, 7716
Offset: 0

Views

Author

Orson R. L. Peters, Jan 30 2017

Keywords

Comments

Touching a unit square does not count as covering. E.g., the disk with radius 5 does not cover the unit square with (3, 4) as bottom-left corner.

Examples

			a(4) = 4 * 15 = 60 because in the positive quadrant 15 unit squares are covered and the problem is symmetrical. In the bounding box of the circle only the unit squares in the corners are not (partially) covered, so a(4) = 8*8 - 4 = 60.
		

Crossrefs

Programs

  • Maple
    N:= 100:  # for a(0)..a(N)
    V:=Array(0..N):
    for i from 0 to N do
      for j from 0 to i do
        r:= sqrt(i^2 + j^2);
        if r::integer then r:= r+1 else r:= ceil(r) fi;
        if r > N then break fi;
        if i=j then m:= 4 else m:= 8 fi;
        V[r..N]:= V[r..N] +~ m;
    od od:
    convert(V,list); # Robert Israel, Feb 21 2025
  • Mathematica
    A281795[n_] := 4*Sum[Ceiling[Sqrt[n^2 - k^2]], {k, 0, n-1}];
    Array[A281795, 100, 0] (* Paolo Xausa, Feb 21 2025 *)
  • Octave
    a = @(n) 4*sum(ceil(sqrt(n.^2-(0:n-1).^2))); % Luis Mendo, Aug 09 2021
  • Python
    a = lambda n: sum(4 for x in range(n) for y in range(n)
                        if x*x + y*y < n*n)
    

Formula

a(n) = 4*A001182(n) + A242118(n). - Andrey Zabolotskiy, Jan 30 2017
a(n) = Sum_{k=0..n-1} 4*ceiling(sqrt(n^2-k^2)). - Luis Mendo, Aug 09 2021

A293289 Number of level n squares on a Sierpinski carpet that intersect the edge of a circle with the same center and diameter.

Original entry on oeis.org

1, 8, 28, 76, 204, 580, 1556, 4180, 11204, 29724, 79276, 212076, 565692, 1509332, 4026028, 10740796, 28646804, 76396620, 203728972, 543283204, 1448779164, 3863345612, 10302538780, 27473690092, 73263231116, 195369181668, 520985280228, 1389296277316, 3704793953044
Offset: 0

Views

Author

Yi Yang, Oct 05 2017

Keywords

Comments

There are 8^n level n squares on a Sierpinski carpet.
The terms of this sequence have a common factor 4 except a(0).
Lim_{n->infinity} a(n)/a(n-1) = 8/3.
Lim_{n->infinity} a(n)/(8/3)^n = 4.38167....

Crossrefs

A244147 Number of hexagons (side length 1) that intersect the circumference of a circle of radius n centered at a lattice point.

Original entry on oeis.org

3, 9, 12, 15, 21, 24, 27, 39, 42, 39, 51, 54, 51, 63, 66, 69, 81, 78, 75, 99, 96, 93, 105, 114, 105, 123, 120, 117, 141, 138, 129, 147, 156, 153, 159, 162, 159, 177, 180, 171, 201, 192, 183, 201, 204, 201, 219, 216, 207, 237, 240, 225, 249, 258, 243, 267, 246, 261, 285, 276
Offset: 1

Views

Author

Kival Ngaokrajang, Jun 21 2014

Keywords

Comments

The pattern repeats itself at every 2*Pi/3 sector along the circumference. The hexagon count per one-third sector by rows can be arranged as an irregular triangle. The double hexagons in a row are symmetrically placed. See illustration.

Crossrefs

A333597 The number of unit cells intersected by the circumference of a circle centered on the origin with radius squared equal to the norm of the Gaussian integers A001481(n).

Original entry on oeis.org

0, 4, 8, 12, 12, 16, 20, 20, 20, 28, 28, 32, 28, 28, 36, 36, 40, 36, 44, 44, 44, 44, 44, 52, 48, 52, 52, 52, 52, 60, 52, 60, 64, 60, 60, 60, 68, 68, 60, 68, 68, 68, 72, 68, 76, 76, 76, 76, 76, 76, 76, 84, 84, 76, 88, 76, 84, 84, 92, 84, 92
Offset: 1

Views

Author

Scott R. Shannon, Mar 28 2020

Keywords

Comments

Draw a circle on a 2D square grid centered at the origin with a radius squared equal to the norm of the Gaussian integers A001481(n). See the images in the links. This sequence gives the number of unit cells intersected by the circumference of the circle. Equivalently this is the number of intersections of the circumference with the x and y integer grid lines.

Crossrefs

Cf. A001481, A055025, A057655, A119439, A242118 (a subsequence of this sequence), A234300.

Formula

a(n) = 4*A234300(2*(n-1)). - Andrey Zabolotskiy, Feb 22 2025

A361192 Number of intersections of a grid and (growing) circle with center at a lattice point.

Original entry on oeis.org

1, 4, 12, 8, 12, 20, 12, 20, 16, 20, 28, 20, 28, 20, 28, 36, 28, 36, 32, 36, 28, 36, 28, 44, 36, 44, 36, 44, 40, 44, 36, 44, 52, 44, 52, 44, 52, 44, 52, 44, 52, 60, 48, 60, 52, 60, 52, 60, 52, 60, 52, 60, 68, 52, 68, 60, 68, 64, 68, 60, 68, 60, 68, 60, 68, 76, 68, 76, 60, 76, 68, 76, 68
Offset: 1

Views

Author

Volodymyr Dykun, Mar 03 2023

Keywords

Comments

Counted intersections are intersections of the circumference of a circle and the grid (all the grid lines together). Beginning with the smallest circle, the radius is increasing, and a new term is added only when the number of intersections changes.
a(n) is a multiple of 4 for all n except 1.

Examples

			a(1)=1 because at the beginning it's just a point. If we start increasing the circle, there would be 4 intersections, so a(2)=4, this holds while the radius is between 0 and 1 (assuming the cells of the grid have side length 1). If the radius is between 1 and sqrt(2), there are 12 intersections, so a(3)=12. After that: r=sqrt(2), a(4)=8; sqrt(2) < r < 2, a(5)=12.
The number of intersections changes when the squared radius reaches a sum of two nonzero squares (A000404) and when it starts exceeding a sum of two squares, so in the latter case there are three consecutive terms of the sequence corresponding to the squared radius smaller than a term of A001481, equal to it, and exceeding it, like a(3)-a(5) in the example above.
		

Crossrefs

A242118 (without 0) and A017113 are subsequences.

Programs

  • Mathematica
    issq[n_] := n == Floor[Sqrt[n]]^2;
    ss[1] = 0; ss[n_] := Product[If[Mod[First@pe, 4] == 1, Last@pe + 1, Boole[EvenQ[Last@pe] || First@pe == 2]], {pe, FactorInteger[n]}] - Boole[issq[n]]; (* A063725, after Charles R Greathouse IV *)
    t = 4; a = {1};
    Do[AppendTo[a, t - 4 ss[n]]; If[issq[n], t += 8]; AppendTo[a, t], {n, 40}];
    First /@ Split[a] (* Andrey Zabolotskiy, Sep 20 2023 *)

Extensions

a(16) and beyond from Andrey Zabolotskiy, Sep 20 2023
Showing 1-9 of 9 results.