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

A324043 Number of quadrilateral regions into which a figure made up of a row of n adjacent congruent rectangles is divided upon drawing diagonals of all possible rectangles.

Original entry on oeis.org

0, 2, 14, 34, 90, 154, 288, 462, 742, 1038, 1512, 2074, 2904, 3774, 4892, 6154, 7864, 9662, 12022, 14638, 17786, 20998, 25024, 29402, 34672, 40038, 46310, 53038, 61090, 69454, 79344, 89890, 101792, 113854, 127476, 141866, 158428, 175182, 193760, 213274, 235444, 258182, 283858, 310750, 339986
Offset: 1

Views

Author

Jinyuan Wang, May 01 2019

Keywords

Comments

A row of n adjacent congruent rectangles can only be divided into triangles (cf. A324042) or quadrilaterals when drawing diagonals. Proof is given in Alekseyev et al. (2015) under the transformation described in A306302.

Examples

			For k adjacent congruent rectangles, the number of quadrilateral regions in the j-th rectangle is:
k\j|  1   2   3   4   5   6   7  ...
---+--------------------------------
1  |  0,  0,  0,  0,  0,  0,  0, ...
2  |  1,  1,  0,  0,  0,  0,  0, ...
3  |  3,  8,  3,  0,  0,  0,  0, ...
4  |  5, 12, 12,  5,  0,  0,  0, ...
5  |  7, 22, 32, 22,  7,  0,  0, ...
6  |  9, 28, 40, 40, 28,  9,  0, ...
7  | 11, 38, 58, 74, 58, 38, 11, ...
...
a(4) = 5 + 12 + 12 + 5 = 34.
		

Crossrefs

Programs

  • Maple
    See Robert Israel link.
    There are also Maple programs for both A306302 and A324042. Then a := n -> A306302(n) - A324042(n); # N. J. A. Sloane, Mar 04 2020
  • Mathematica
    Table[Sum[Sum[(Boole[GCD[i, j] == 1] - 2 * Boole[GCD[i, j] == 2]) * (n + 1 - i) * (n + 1 - j), {j, 1, n}], {i, 1, n}] - n^2, {n, 1, 45}] (* Joshua Oliver, Feb 05 2020 *)
  • PARI
    { A324043(n) = sum(i=1, n, sum(j=1, n, ( (gcd(i, j)==1) - 2*(gcd(i,j)==2) ) * (n+1-i) * (n+1-j) )) - n^2; } \\ Max Alekseyev, Jul 08 2019
    
  • Python
    from sympy import totient
    def A324043(n): return 0 if n==1 else -2*(n-1)**2 + sum(totient(i)*(n+1-i)*(7*i-2*n-2) for i in range(2,n//2+1)) + sum(totient(i)*(n+1-i)*(2*n+2-i) for i in range(n//2+1,n+1)) # Chai Wah Wu, Aug 16 2021

Formula

a(n) = A115005(n+1) - A177719(n+1) - n - 1 = Sum_{i,j=1..n; gcd(i,j)=1} (n+1-i)*(n+1-j) - 2*Sum_{i,j=1..n; gcd(i,j)=2} (n+1-i)*(n+1-j) - n^2. - Max Alekseyev, Jul 08 2019
a(n) = A306302(n) - A324042(n).
For n>1, a(n) = -2(n-1)^2 + Sum_{i=2..floor(n/2)} (n+1-i)*(7i-2n-2)*phi(i) + Sum_{i=floor(n/2)+1..n} (n+1-i)*(2n+2-i)*phi(i). - Chai Wah Wu, Aug 16 2021

Extensions

a(8)-a(23) from Robert Israel, Jul 07 2019
Terms a(24) onward from Max Alekseyev, Jul 08 2019

A324042 Number of triangular regions into which a figure made up of a row of n adjacent congruent rectangles is divided upon drawing diagonals of all possible rectangles.

Original entry on oeis.org

4, 14, 32, 70, 124, 226, 360, 566, 820, 1218, 1696, 2310, 3020, 4018, 5160, 6590, 8196, 10218, 12464, 15110, 18012, 21650, 25624, 30142, 35028, 40954, 47344, 54558, 62284, 71034, 80360, 90806, 101892, 114770, 128416, 143286, 158972, 176914, 195816, 216350, 237908, 261546, 286304, 313102, 341100
Offset: 1

Views

Author

Jinyuan Wang, May 01 2019

Keywords

Comments

A row of n adjacent congruent rectangles can only be divided into triangles or quadrilaterals when drawing diagonals. A proof is given in Alekseyev et al. (2015) using the mapping to a dissection of a a right isosceles triangle described in A306302.

Examples

			For k adjacent congruent rectangles, the number of triangular regions in the j-th rectangle is:
k\j|  1   2   3   4   5   6   7  ...
---+--------------------------------
1  |  4,  0,  0,  0,  0,  0,  0, ...
2  |  7,  7,  0,  0,  0,  0,  0, ...
3  |  9, 14,  9,  0,  0,  0,  0, ...
4  | 11, 24, 24, 11,  0,  0,  0, ...
5  | 13, 30, 38, 30, 13,  0,  0, ...
6  | 15, 38, 60, 60, 38, 15,  0, ...
7  | 17, 44, 76, 86, 76, 44, 17, ...
...
a(4) = 11 + 24 + 24 + 11 = 70.
		

Crossrefs

Programs

  • Maple
    V := proc(m,n,q) local a,i,j; a:=0;
    for i from 1 to m do for j from 1 to n do
    if gcd(i,j)=q then a:=a+(m+1-i)*(n+1-j); fi; od: od: a; end;
    a := n -> 2*( n*(n+1) + V(n,n,2) );
    [seq(a(n), n=1..30)]; # N. J. A. Sloane, Mar 04 2020
    See also Robert Israel link.
  • Mathematica
    Table[2 * (n^2 + n + Sum[Sum[Boole[GCD[i, j] == 2] * (n + 1 - i) * (n + 1 - j), {j, 1, n}], {i, 1, n}]), {n, 1, 45}]  (* Joshua Oliver, Feb 05 2020 *)
  • PARI
    { A324042(n) = 2*((n+1)*n + sum(i=1, n, sum(j=1, n, (gcd(i, j)==2)*(n+1-i)*(n+1-j))) ); } \\ Max Alekseyev, Jul 08 2019
    
  • Python
    from sympy import totient
    def A324042(n): return 2*(2*n**2-n+1 + 2*sum(totient(i)*(n+1-2*i)*(n+1-i) for i in range(2,n//2+1))) # Chai Wah Wu, Aug 16 2021

Formula

a(n) = A177719(n+1) + 2*(n+1) = 2 * ( (n+1)*n + Sum_{i,j=1..n; gcd(i,j)=2} (n+1-i)*(n+1-j) ). - Max Alekseyev, Jul 08 2019
a(n) = A306302(n) - A324043(n).
a(n) = 2*(2*n^2-n+1+2*Sum_{i=2..floor(n/2)} (n+1-2*i)*(n+1-i)*phi(i)). - Chai Wah Wu, Aug 16 2021

Extensions

a(8)-a(23) from Robert Israel, Jul 07 2019
Terms a(24) onward from Max Alekseyev, Jul 08 2019

A332353 Triangle read by rows: T(m,n) = Sum_{-m= n >= 1.

Original entry on oeis.org

0, 0, 0, 1, 2, 8, 2, 4, 14, 24, 3, 6, 22, 38, 60, 4, 8, 30, 52, 82, 112, 5, 10, 40, 70, 112, 154, 212, 6, 12, 50, 88, 142, 196, 270, 344, 7, 14, 62, 110, 178, 246, 340, 434, 548, 8, 16, 74, 132, 214, 296, 410, 524, 662, 800, 9, 18, 88, 158, 258, 358, 498, 638, 808, 978, 1196
Offset: 1

Views

Author

N. J. A. Sloane, Feb 10 2020

Keywords

Comments

This is the triangle in A332352, halved.

Examples

			Triangle begins:
0,
0, 0,
1, 2, 8,
2, 4, 14, 24,
3, 6, 22, 38, 60,
4, 8, 30, 52, 82, 112,
5, 10, 40, 70, 112, 154, 212,
6, 12, 50, 88, 142, 196, 270, 344,
7, 14, 62, 110, 178, 246, 340, 434, 548,
8, 16, 74, 132, 214, 296, 410, 524, 662, 800,
...
		

Crossrefs

The main diagonal is A177719.

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;
    for m from 1 to 12 do lprint(seq(VR(m,n,2)/2,n=1..m),); od:
  • Mathematica
    A332353[m_,n_]:=Sum[If[GCD[i,j]==2,2(m-i)(n-j),0],{i,2,m-1,2},{j,2,n-1,2}]+If[n>2,m*n-2m,0]+If[m>2,m*n-2n,0];Table[A332353[m, n],{m,15},{n, m}] (* Paolo Xausa, Oct 18 2023 *)
Showing 1-3 of 3 results.