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.

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

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
Showing 1-2 of 2 results.