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.

A344993 Number of polygons formed when every pair of vertices of a row of n adjacent congruent rectangles are joined by an infinite line.

Original entry on oeis.org

0, 4, 20, 68, 168, 368, 676, 1184, 1912, 2944, 4292, 6152, 8456, 11484, 15164, 19624, 24944, 31508, 39076, 48212, 58656, 70672, 84284, 100192, 117888, 138100, 160580, 185796, 213568, 245008, 279116, 317424, 359280, 405124, 454868, 509264, 567640, 631988, 701228, 776032, 855968, 943260, 1035844
Offset: 0

Views

Author

Keywords

Comments

The number of polygons formed inside the rectangles is A306302(n), while the number of polygons formed outside the rectangles is 2*A332612(n+1).
The number of open regions, those outside the polygons with unbounded area and two edges that go to infinity, for n >= 1 is given by 2*n^2 + 4*n + 6 = A255843(n+1).
Like A306302(n) is appears only 3-gons and 4-gons are generated by the infinite lines.

Examples

			a(1) = 4 as connecting the four vertices of a single rectangle forms four triangles inside the rectangle. Twelve open regions outside these triangles are also formed.
a(2) = 20 as connecting the six vertices of two adjacent rectangles forms two quadrilaterals and fourteen triangles inside the rectangles while also forming four triangles outside the rectangles, giving twenty polygons in total. Twenty-two open regions outside these polygons are also formed.
See the linked images for further examples.
		

Crossrefs

See A347750 and A347751 for the numbers of vertices and edges in the finite part of the corresponding graph.
Cf. A332612 (half the number of polygons outside the rectangles), A306302 (number of polygons inside the rectangles), A255843.

Programs

  • Python
    from sympy import totient
    def A344993(n): return 2*n*(n+1) + 2*sum(totient(i)*(n+1-i)*(2*n+2-i) for i in range(2,n+1)) # Chai Wah Wu, Aug 21 2021

Formula

a(n) = 2*A332612(n+1) + A306302(n) = 2*Sum_{i=2..n, j=1..i-1, gcd(i,j)=1} (n+1-i)*(n+1-j) + Sum_{i=1..n, j=1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) + n^2 + 2*n.
a(n) = 2*n*(n+1) + 2*Sum_{i=2..n} (n+1-i)*(2*n+2-i)*phi(i). - Chai Wah Wu, Aug 21 2021

A331771 a(n) = Sum_{-n

Original entry on oeis.org

0, 12, 56, 172, 400, 836, 1496, 2564, 4080, 6212, 8984, 12788, 17488, 23644, 31112, 40148, 50912, 64172, 79448, 97868, 118912, 143108, 170504, 202500, 238080, 278700, 323864, 374508, 430272, 493380, 561832, 638692, 722656, 814604, 914360, 1023428
Offset: 1

Views

Author

N. J. A. Sloane, Feb 08 2020

Keywords

Comments

a(n) = 8*A332612(n)+4*n*(n-1)+4*(n-1)^2. Also adding 2 to the terms of the present sequence gives (essentially) A114146. - N. J. A. Sloane, Mar 14 2020

References

  • Koplowitz, Jack, Michael Lindenbaum, and A. Bruckstein. "The number of digital straight lines on an N* N grid." IEEE Transactions on Information Theory 36.1 (1990): 192-197. (See I(n).)

Crossrefs

When divided by 4 this becomes A115005, so this is a ninth sequence to add to the following list.
The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n.
Cf. A332612.

Programs

  • Maple
    VR := proc(m,n,q) local a,i,j; a:=0;
    for i from -m+1 to m-1 do for j from -n+1 to n-1 do
    if gcd(i,j)=q then a:=a+(m-abs(i))*(n-abs(j)); fi; od: od: a; end;
    [seq(VR(n,n,1),n=1..50)];
  • Mathematica
    a[n_] := Sum[Boole[GCD[i, j] == 1] (n - Abs[i]) (n - Abs[j]), {i, -n + 1, n - 1}, {j, -n + 1, n - 1}];
    Array[a, 36] (* Jean-François Alcover, Apr 19 2020 *)
  • Python
    from sympy import totient
    def A331771(n): return 4*((n-1)*(2*n-1)+sum(totient(i)*(n-i)*(2*n-i) for i in range(2,n))) # Chai Wah Wu, Aug 17 2021

Formula

a(n) = 4 * A115005(n).
a(n) = 4*((n-1)*(2n-1)+Sum_{i=2..n-1} (n-i)*(2*n-i)*phi(i)). - Chai Wah Wu, Aug 17 2021
Showing 1-2 of 2 results.