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-10 of 13 results. Next

A332596 Number of quadrilateral regions in a "frame" of size n X n (see Comments in A331776 for definition), divided by 8.

Original entry on oeis.org

0, 1, 10, 26, 63, 107, 189, 294, 455, 627, 891, 1202, 1650, 2121, 2719, 3392, 4292, 5239, 6470, 7832, 9463, 11129, 13205, 15460, 18164, 20919, 24130, 27572, 31679, 35945, 40977, 46340, 52384, 58511, 65421, 72718, 81104, 89589, 98989, 108860, 120062, 131551
Offset: 1

Views

Author

Keywords

Comments

See A331776 for many other illustrations.
Theorem. Let z(n) = Sum_{i, j = 1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) (this is A115004) and z_2(n) = Sum_{i, j = 1..n, gcd(i,j)=2} (n+1-i)*(n+1-j) (this is A331761). Then, for n >= 2, 8*a(n) = 4*z(n) - 8*z_2(n) + 8*n^2 - 36*n + 24. - Scott R. Shannon and N. J. A. Sloane, Mar 06 2020

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;
    f := n -> if n=1 then 0 else 8*n^2 - 36*n + 24 + 4*V(n,n,1) 8*V(n, n, 2); fi;
    [seq(f(n)/8, n=1..60)]; # N. J. A. Sloane, Mar 10 2020
  • PARI
    a(n) = sum(i=1, n, sum(j=1, n, if(gcd(i, j)==1, (n+1-i)*(n+1-j), 0)))/2 - sum(i=1, n, sum(j=1, n, if(gcd(i, j)==2, (n+1-i)*(n+1-j), 0))) + n^2 - 9*n/2 + 3; \\ Jinyuan Wang, Aug 07 2021
    
  • Python
    from sympy import totient
    def A332596(n): return 0 if n == 1 else ((n-1)*(n-4) - sum(totient(i)*(n+1-i)*(2*n+2-7*i) 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)))//2 # Chai Wah Wu, Aug 16 2021

Formula

For n > 1, a(n) = ((n-1)*(n-4) - Sum_{i=2..floor(n/2)} (n+1-i)*(2*n+2-7*i)*phi(i) + Sum_{i=floor(n/2)+1..n} (n+1-i)*(2*n+2-i)*phi(i))/2. - Chai Wah Wu, Aug 16 2021

Extensions

More terms from N. J. A. Sloane, Mar 10 2020

A332594 A331776(n)/4.

Original entry on oeis.org

1, 14, 52, 124, 254, 446, 746, 1164, 1742, 2486, 3494, 4732, 6340, 8282, 10622, 13400, 16808, 20726, 25436, 30808, 36974, 43946, 52074, 61104, 71400, 82838, 95652, 109752, 125694, 142978, 162370, 183544, 206720, 231854, 259322, 288788, 321248, 356162, 393866, 434144, 478108, 524726, 575408, 629352, 686846, 747914
Offset: 1

Views

Author

Keywords

Extensions

More terms from N. J. A. Sloane, Mar 09 2020

A332595 Number of triangular regions in a "frame" of size n X n (see Comments in A331776 for definition), divided by 4.

Original entry on oeis.org

1, 12, 32, 72, 128, 232, 368, 576, 832, 1232, 1712, 2328, 3040, 4040, 5184, 6616, 8224, 10248, 12496, 15144, 18048, 21688, 25664, 30184, 35072, 41000, 47392, 54608, 62336, 71088, 80416, 90864, 101952, 114832, 128480, 143352, 159040, 176984, 195888, 216424, 237984, 261624, 286384, 313184, 341184, 372496, 405184
Offset: 1

Views

Author

Keywords

Comments

See A331776 for many other illustrations.
Theorem. Let z_2(n) = Sum_{i, j = 1..n, gcd(i,j)=2} (n+1-i)*(n+1-j) (this is A331761). Then, for n >= 2, a(n) = 2*(z_2(n) + (n+3)*(n-1)). - Scott R. Shannon and N. J. A. Sloane, Mar 06 2020

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;
    f := n -> if n=1 then 4 else 8*n^2 + 16*n - 24 + 8*V(n,n,2); fi;
    [seq(f(n)/4, n=1..60)]; # N. J. A. Sloane, Mar 09 2020

Extensions

More terms from N. J. A. Sloane, Mar 09 2020

A332597 Number of edges in a "frame" of size n X n (see Comments in A331776 for definition).

Original entry on oeis.org

8, 92, 360, 860, 1792, 3124, 5256, 8188, 12304, 17460, 24568, 33244, 44688, 58228, 74664, 94028, 118080, 145380, 178568, 216252, 259776, 308276, 365352, 428556, 501152, 580804, 670536, 768908, 880992, 1001764, 1138248, 1286748, 1449984, 1625300, 1817752, 2023740, 2252048, 2495476, 2759304, 3040460, 3349056
Offset: 1

Views

Author

Keywords

Comments

See A331776 for many other illustrations.
Theorem. Let z(n) = Sum_{i, j = 1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) (this is A115004) and z_2(n) = Sum_{i, j = 1..n, gcd(i,j)=2} (n+1-i)*(n+1-j) (this is A331761). Then, for n >= 2, a(n) = 8*z(n) - 4*z_2(n) + 28*n^2 - 44*n + 8. - Scott R. Shannon and N. J. A. Sloane, Mar 06 2020

Crossrefs

Cf. A115004, A331761, A331776 (regions), A332598 (vertices).

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;
    f := n -> if n=1 then 8 else 28*n^2 - 44*n + 8 + 8*V(n,n,1) - 4*V(n, n, 2); fi;
    [seq(f(n), n=1..50)]; # N. J. A. Sloane, Mar 10 2020
  • Python
    from sympy import totient
    def A332597(n): return 8 if n == 1 else 4*(n-1)*(8*n-1) + 8*sum(totient(i)*(n+1-i)*(n+i+1) for i in range(2,n//2+1)) + 8*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

For n > 1, a(n) = 4*(n-1)*(8*n-1) + 8*Sum_{i=2..floor(n/2)} (n+1-i)*(n+i+1)*phi(i) + 8*Sum_{i=floor(n/2)+1..n} (n+1-i)*(2*n+2-i)*phi(i). - Chai Wah Wu, Aug 16 2021

Extensions

More terms from N. J. A. Sloane, Mar 10 2020

A332598 Number of vertices in a "frame" of size n X n (see Comments in A331776 for definition).

Original entry on oeis.org

5, 27, 152, 364, 776, 1340, 2272, 3532, 5336, 7516, 10592, 14316, 19328, 25100, 32176, 40428, 50848, 62476, 76824, 93020, 111880, 132492, 157056, 184140, 215552, 249452, 287928, 329900, 378216, 429852, 488768, 552572, 623104, 697884, 780464, 868588, 967056
Offset: 1

Views

Author

Keywords

Comments

See A331776 for many other illustrations.
Theorem. Let z(n) = Sum_{i, j = 1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) (this is A115004) and z_2(n) = Sum_{i, j = 1..n, gcd(i,j)=2} (n+1-i)*(n+1-j) (this is A331761). Then, for n >= 3, a(n) = 4*z(n) - 4*z_2(n) + 12*n^2 - 24*n + 8. (This does not hold for n<3, because it uses Euler's formula, and the graph for n<3 has no hole, so has genus 0, whereas for n>=3 there is a hole and the graph has genus 1.) - Scott R. Shannon and N. J. A. Sloane, Mar 04 2020

Crossrefs

Cf. A331776 (regions), A332597 (edges).

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;
    f := n -> if n=1 then 5 elif n=2 then 27 else 12*n^2 - 24*n + 8 + 4*V(n,n,1) - 4*V(n, n, 2); fi;
    [seq(f(n), n=1..50)]; # N. J. A. Sloane, Mar 10 2020
  • PARI
    a(n) = if(n<3, 22*n - 17, 4*sum(i=1, n, sum(j=1, n, if(gcd(i, j)==1, (n+1-i)*(n+1-j), 0))) - 4*sum(i=1, n, sum(j=1, n, if(gcd(i, j)==2, (n+1-i)*(n+1-j), 0))) + 12*n^2 - 24*n + 8); \\ Jinyuan Wang, Aug 07 2021
    
  • Python
    from sympy import totient
    def A332598(n): return 22*n-17 if n <= 2 else 4*(n-1)*(3*n-1) + 12*sum(totient(i)*(n+1-i)*i for i in range(2,n//2+1)) + 4*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

For n > 2, a(n) = 4*(n-1)*(3n-1)+12*Sum_{i=2..floor(n/2)} (n+1-i)*i*phi(i) + 4*Sum_{i=floor(n/2)+1..n} (n+1-i)*(2*n+2-i)*phi(i). - Chai Wah Wu, Aug 16 2021

Extensions

More terms from N. J. A. Sloane, Mar 10 2020

A332599 Triangle read by rows: T(n,k) = number of vertices in a "frame" of size n X k (see Comments in A331457 for definition).

Original entry on oeis.org

5, 13, 37, 35, 99, 152, 75, 213, 256, 364, 159, 401, 448, 568, 776, 275, 657, 704, 836, 1056, 1340, 477, 1085, 1132, 1276, 1508, 1804, 2272, 755, 1619, 1712, 1868, 2112, 2420, 2900, 3532, 1163, 2327, 2552, 2720, 2976, 3296, 3788, 4432, 5336, 1659, 3257, 3568, 3748, 4016, 4348, 4852, 5508, 6424, 7516
Offset: 1

Views

Author

Keywords

Comments

See A331457 and A331776 for further illustrations.
There is a crucial difference between frames of size nX2 and size nXk with k = 1 or k >= 3. If k != 2, all regions are either triangles or quadrilaterals, but for k=2 regions with larger numbers of sides can appear. Remember also that for k <= 2, the "frame" has no hole, and the graph has genus 0, whereas for k >= 3 there is a nontrivial hole and the graph has genus 1.

Examples

			Triangle begins:
[5],
[13, 37],
[35, 99, 152],
[75, 213, 256, 364],
[159, 401, 448, 568, 776],
[275, 657, 704, 836, 1056, 1340],
[477, 1085, 1132, 1276, 1508, 1804, 2272],
[755, 1619, 1712, 1868, 2112, 2420, 2900, 3532],
[1163, 2327, 2552, 2720, 2976, 3296, 3788, 4432, 5336],
[1659, 3257, 3568, 3748, 4016, 4348, 4852, 5508, 6424, 7516],
...
		

Crossrefs

The main diagonal is A332598.

Formula

Column 1 is A331755, for which there is an explicit formula.
Column 2 is A331763, for which no formula is known.
For m >= n >= 3, T(m,n) = A332600(m,n) - A331457(m,n) (Euler for genus 1 graph), and both A332600 and A331457 have explicit formulas.

Extensions

More terms from N. J. A. Sloane, Mar 13 2020

A332600 Triangle read by rows: T(n,k) = number of edges in a "frame" of size n X k (see Comments in A331457 for definition).

Original entry on oeis.org

8, 28, 92, 80, 240, 360, 178, 508, 604, 860, 372, 944, 1040, 1320, 1792, 654, 1548, 1652, 1956, 2452, 3124, 1124, 2520, 2640, 2968, 3488, 4184, 5256, 1782, 3754, 4004, 4356, 4900, 5620, 6716, 8188, 2724, 5392, 5936, 6312, 6880, 7624, 8744, 10240, 12304, 3914, 7528, 8364, 8764, 9356, 10124, 11268, 12788, 14876, 17460
Offset: 1

Views

Author

Keywords

Comments

See A331457 and A331776 for further illustrations.
There is a crucial difference between frames of size nX2 and size nXk with k = 1 or k >= 3. If k != 2, all regions are either triangles or quadrilaterals, but for k=2 regions with larger numbers of sides can appear. Remember also that for k <= 2, the "frame" has no hole, and the graph has genus 0, whereas for k >= 3 there is a nontrivial hole and the graph has genus 1.

Examples

			Triangle begins:
[8],
[28, 92],
[80, 240, 360],
[178, 508, 604, 860],
[372, 944, 1040, 1320, 1792],
[654, 1548, 1652, 1956, 2452, 3124],
[1124, 2520, 2640, 2968, 3488, 4184, 5256],
[1782, 3754, 4004, 4356, 4900, 5620, 6716, 8188],
[2724, 5392, 5936, 6312, 6880, 7624, 8744, 10240, 12304],
[3914, 7528, 8364, 8764, 9356, 10124, 11268, 12788, 14876, 17460],
...
		

Crossrefs

The main diagonal is A332597.

Formula

Column 1 is A331757, for which there is an explicit formula.
Column 2 is A331765, for which no formula is known.
For m >= n >= 3, T(m,n) = (3*A332610(m,n)+4*A332611(m,n)+4*m+4*n-8)/2, and both A332610 and A332611 have explicit formulas.

Extensions

More terms from N. J. A. Sloane, Mar 13 2020

A331457 Triangle read by rows: T(n,k) = number of regions in a "frame" of size n X k (see Comments for definition).

Original entry on oeis.org

4, 16, 56, 46, 142, 208, 104, 296, 348, 496, 214, 544, 592, 752, 1016, 380, 892, 948, 1120, 1396, 1784, 648, 1436, 1508, 1692, 1980, 2380, 2984, 1028, 2136, 2292, 2488, 2788, 3200, 3816, 4656, 1562, 3066, 3384, 3592, 3904, 4328, 4956, 5808, 6968, 2256, 4272, 4796, 5016, 5340, 5776, 6416, 7280, 8452, 9944
Offset: 1

Views

Author

Keywords

Comments

A "frame" of size n X k is formed from a grid of (n+1) X (k+1) points with the central grid of (n-3) X (k-3) points removed. If n or k is less than 3 then no points are removed, and T(n,k) = A331452(n,k). From now on we assume both n and k are >= 3.
The resulting array has an outer perimeter with 2*(n+k) points and an inner perimeter with 2*(n+k)-8 points, for a total of 4*(n+k)-8 perimeter points. The frame itself is the strip of width 1 between the inner and outer perimeters.
Now join every pair of perimeter points, both inner and outer, by a line segment, provided the line remains inside the frame. The sequence gives the number of regions in the resulting figure.
See A331776 for additional illustrations for the diagonal entries.
There is a crucial difference between frames of size nX2 and size nXk with k = 1 or k >= 3. If k != 2, all regions are either triangles or quadrilaterals, but for k=2 regions with larger numbers of sides can appear. Remember also that for k <= 2, the "frame" has no hole, and the graph has genus 0, whereas for k >= 3 there is a nontrivial hole and the graph has genus 1.

Examples

			Triangle begins:
4,
16,56,
46,142,208,
104,296,348,496,
214,544,592,752,1016
380,892,948,1120,1396,1784
648,1436,1508,1692,1980,2380,2984
1028,2136,2292,2488,2788,3200,3816,4656
1562,3066,3384,3592,3904,4328,4956,5808,6968
2256,4272,4796,5016,5340,5776,6416,7280,8452,9944
		

Crossrefs

Cf. A332599 (triangle giving numbers of vertices) and A332600 (edges).
Cf. also A331452.
The first column is A306302, the main diagonal is A331776.

Formula

Column 1 is A306302, for which there is an explicit formula.
Column 2 is A331766, for which no formula is known.
For n >= k >= 3, T(n,k) = A332610(n,k) + A332611(n,k), both of which have explicit formulas.

Extensions

More terms from Scott R. Shannon, Mar 05 2020
a(8) corrected by Giovanni Resta, May 22 2025

A333031 Number of vertices in an equilateral triangle "frame" of size n (see Comments in A328526 for definition).

Original entry on oeis.org

3, 10, 58, 183, 408, 777, 1323, 2142, 3276, 4773, 6717, 9264, 12507, 16554, 21351, 27090, 34047, 42318, 52008, 63453, 76566, 91371, 108249, 127608, 149487, 173982, 201072, 231225, 265002, 302487, 343857, 389856, 440175, 494670, 553611, 617610, 687477, 763320
Offset: 1

Views

Author

Keywords

Comments

For n<=3 the terms equal A274585(n). See A328526 for images of the triangular frame.

Crossrefs

Cf. A328526 (regions), A333030 (edges), A333032 (3-gons), A333033 (4-gons), A331776 (square frame), A274586 (filled triangle).

Extensions

a(12) and beyond from Lars Blomberg, May 01 2020

A328526 Number of regions in an equilateral triangle "frame" of size n.

Original entry on oeis.org

1, 12, 75, 249, 543, 1023, 1746, 2814, 4293, 6267, 8868, 12228, 16464, 21774, 28176, 35832, 45066, 56040, 68931, 84033, 101307, 120987, 143574, 169290, 198222, 230790, 267117, 307455, 352437, 402255, 457182, 517986, 584454, 656874, 735708, 821076, 913860
Offset: 1

Views

Author

Keywords

Comments

A equilateral triangular "frame" of size n is formed from a triangular grid consisting of an outer edge of (n+1) points with the central grid of (n-5)*(n-6)/2 points removed. If n is less than 4 then no points or triangles are removed, and a(n) = A092867(n). From now on we assume n >= 4.
If we focus on the triangles rather than the points, the frame consists of a grid of equilateral triangles with the central block of (n-3)^2 triangles removed.
The resulting structure has an outer perimeter with 3*n points and an inner perimeter with 3*n-9 points, for a total of 6*n-9 perimeter points. The frame itself is the strip equilateral triangles pointing in alternate directions between the inner and outer perimeters such that the frame thickness equals the height of one triangle.
Now join every pair of perimeter points, both inner and outer, by a line segment, provided the line remains inside the frame. The sequence gives the number of regions in the resulting figure.
Like the square frame of A331776 only regions with 3 or 4 edges are formed.

Crossrefs

Cf. A333030 (edges), A333031 (vertices), A333032 (3-gons), A333033 (4-gons), A331776 (square frame), A092867 (filled triangle).

Extensions

a(12) and beyond from Lars Blomberg, May 01 2020
Showing 1-10 of 13 results. Next