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 11 results. Next

A115006 Row 2 of array in A114999.

Original entry on oeis.org

0, 3, 8, 16, 26, 39, 54, 72, 92, 115, 140, 168, 198, 231, 266, 304, 344, 387, 432, 480, 530, 583, 638, 696, 756, 819, 884, 952, 1022, 1095, 1170, 1248, 1328, 1411, 1496, 1584, 1674, 1767, 1862, 1960, 2060, 2163, 2268, 2376, 2486, 2599, 2714, 2832, 2952, 3075, 3200
Offset: 0

Views

Author

N. J. A. Sloane, Feb 23 2006

Keywords

Comments

Number of lattice points (x,y) in the region of the coordinate plane bounded by y < 3x+1, y > x/2 and x <= n. - Wesley Ivan Hurt, Oct 27 2014

Crossrefs

Cf. A114999, A000217 (triangular numbers), A002620 (quarter-squares), A001859 (triangular numbers plus quarter-squares), A017305 (10n+3), A147874 (zero followed by partial sums of A017305).
Partial Sums of A047218.

Programs

  • Magma
    [ n*(n+1) + (n+1)^2 div 4: n in [0..50] ];
    
  • Maple
    A115006:=n->(10*n^2 + 12*n + 1 - (-1)^n)/8: seq(A115006(n), n=0..50); # Wesley Ivan Hurt, Oct 27 2014
  • Mathematica
    Table[(10*n^2 + 12*n + 1 - (-1)^n)/8, {n, 0, 50}] (* Wesley Ivan Hurt, Oct 27 2014 *)
    LinearRecurrence[{2,0,-2,1},{0,3,8,16},60] (* Harvey P. Dale, Jan 13 2015 *)
  • PARI
    {for(n=0, 50, print1(n*(n+1)+floor((n+1)^2/4), ","))}

Formula

a(n) = floor((n+1)^2/4)+n*(n+1).
G.f.: x*(2*x+3)/((1-x)^3*(1+x)).
From Wesley Ivan Hurt, Oct 27 2014: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4).
a(n) = (10*n^2 + 12*n + 1 - (-1)^n)/8.
a(n) = Sum_{i=1..n+1} (10*i + (-1)^i - 9)/4. (End)
E.g.f.: (x*(11 + 5*x)*cosh(x) + (1 + 11*x + 5*x^2)*sinh(x))/4. - Stefano Spezia, Aug 22 2023

Extensions

Edited by Klaus Brockhaus, Nov 18 2008

A115007 Row 3 of array in A114999.

Original entry on oeis.org

0, 6, 16, 31, 50, 75, 103, 137, 175, 218, 265, 318, 374, 436, 502, 573, 648, 729, 813, 903, 997, 1096, 1199, 1308, 1420, 1538, 1660, 1787, 1918, 2055, 2195, 2341, 2491, 2646, 2805, 2970, 3138, 3312, 3490, 3673, 3860, 4053, 4249, 4451, 4657, 4868, 5083, 5304, 5528
Offset: 0

Views

Author

N. J. A. Sloane, Feb 23 2006

Keywords

A115004 a(n) = Sum_{i=1..n, j=1..n, gcd(i,j)=1} (n+1-i)*(n+1-j).

Original entry on oeis.org

1, 8, 31, 80, 179, 332, 585, 948, 1463, 2136, 3065, 4216, 5729, 7568, 9797, 12456, 15737, 19520, 24087, 29308, 35315, 42120, 50073, 58920, 69025, 80264, 92871, 106756, 122475, 139528, 158681, 179608, 202529, 227400, 254597, 283784, 315957, 350576, 387977
Offset: 1

Views

Author

N. J. A. Sloane, Feb 23 2006

Keywords

Comments

Also (1/4) * number of ways to select 3 distinct points forming a triangle of unsigned area = 1/2 from a square of grid points with side length n. Diagonal of triangle A320541. - Hugo Pfoertner, Oct 22 2018
From Chai Wah Wu, Aug 18 2021: (Start)
Theorem: a(n) = n^2 + Sum_{i=2..n} (n+1-i)*(2*n+2-i)*phi(i).
Proof: Since gcd(n,n) = 1 if and only if n = 1, Sum_{i=1..n, j=1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) = n^2 + Sum_{i=1..n, j=1..n, gcd(i,j)=1, (i,j) <> (1,1)} (n+1-i)*(n+1-j)
= n^2 + Sum_{i=2..n, j=1..i, gcd(i,j)=1} (n+1-i)*(n+1-j) + Sum_{j=2..n, i=1..j, gcd(i,j)=1} (n+1-i)*(n+1-j) = n^2 + 2*Sum_{i=2..n, j=1..i, gcd(i,j)=1} (n+1-i)*(n+1-j), i.e., the diagonal is not double-counted.
This is equal to n^2 + 2*Sum_{i=2..n, j is a totative of i} (n+1-i)*(n+1-j). Since Sum_{j is a totative of i} 1 = phi(i) and for i > 1, Sum_{j is a totative of i} j = i*phi(i)/2, the conclusion follows.
Similar argument holds for corresponding formulas for A088658, A114043, A114146, A115005, etc.
(End)

Crossrefs

The following eight sequences are all essentially the same. The simplest is the present sequence, 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. - N. J. A. Sloane, Feb 04 2020
Main diagonal of array in A114999.

Programs

  • Maple
    A115004 := proc(n)
        local a,b,r ;
        r := 0 ;
        for a from 1 to n do
        for b from 1 to n do
            if igcd(a,b) = 1 then
                r := r+(n+1-a)*(n+1-b);
            end if;
        end do:
        end do:
        r ;
    end proc:
    seq(A115004(n),n=1..30); # R. J. Mathar, Jul 20 2017
  • Mathematica
    a[n_] := Sum[(n-i+1) (n-j+1) Boole[GCD[i, j] == 1], {i, n}, {j, n}];
    Array[a, 40] (* Jean-François Alcover, Mar 23 2020 *)
  • PARI
    a(n) = n^2 + sum(i=2, n, (n+1-i)*(2*n+2-i)*eulerphi(i)); \\ Michel Marcus, May 08 2024
  • Python
    from math import gcd
    def a115004(n):
        r=0
        for a in range(1, n + 1):
            for b in range(1, n + 1):
                if gcd(a, b)==1:
                    r+=(n + 1 - a)*(n + 1 - b)
        return r
    print([a115004(n) for n in range(1, 51)]) # Indranil Ghosh, Jul 21 2017
    
  • Python
    from sympy import totient
    def A115004(n): return n**2 + sum(totient(i)*(n+1-i)*(2*n+2-i) for i in range(2,n+1)) # Chai Wah Wu, Aug 15 2021
    

Formula

a(n) = Sum_{i=1..n, j=1..n, gcd(i,j)=1} (n+1-i)*(n+1-j).
As n -> oo, a(n) ~ (3/2)*n^4/Pi^2. This follows from Max Alekseyev's formula in A114043. - N. J. A. Sloane, Jul 03 2020
a(n) = n^2 + Sum_{i=2..n} (n+1-i)*(2n+2-i)*phi(i). - Chai Wah Wu, Aug 15 2021

A335678 Array read by antidiagonals: T(m,n) (m>=1, n>=1) = number of cells in figure formed by taking m equally spaced points on a line and n equally spaced points on a parallel line, and joining each of the m points to each of the n points by a line segment.

Original entry on oeis.org

0, 1, 1, 2, 4, 2, 3, 8, 8, 3, 4, 13, 16, 13, 4, 5, 19, 27, 27, 19, 5, 6, 26, 40, 46, 40, 26, 6, 7, 34, 56, 69, 69, 56, 34, 7, 8, 43, 74, 98, 104, 98, 74, 43, 8, 9, 53, 95, 130, 149, 149, 130, 95, 53, 9, 10, 64, 118, 168, 198, 214, 198, 168, 118, 64, 10, 11, 76, 144, 210, 257, 285, 285, 257, 210, 144, 76, 11
Offset: 1

Views

Author

Keywords

Comments

The case m=n (the main diagonal) is dealt with in A306302, where there are illustrations for m = 1 to 15.

Examples

			The initial rows of the array are:
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
  1, 4, 8, 13, 19, 26, 34, 43, 53, 64, 76, 89, ...
  2, 8, 16, 27, 40, 56, 74, 95, 118, 144, 172, 203, ...
  3, 13, 27, 46, 69, 98, 130, 168, 210, 257, 308, 365, ...
  4, 19, 40, 69, 104, 149, 198, 257, 322, 395, 474, 563, ...
  5, 26, 56, 98, 149, 214, 285, 371, 466, 573, 688, 818, ...
  6, 34, 74, 130, 198, 285, 380, 496, 624, 768, 922, 1097, ...
  7, 43, 95, 168, 257, 371, 496, 648, 816, 1005, 1207, 1437, ...
  8, 53, 118, 210, 322, 466, 624, 816, 1028, 1267, 1522, 1813, ...
  9, 64, 144, 257, 395, 573, 768, 1005, 1267, 1562, 1877, 2237, ...
  10, 76, 172, 308, 474, 688, 922, 1207, 1522, 1877, 2256, 2690, ...
  ...
The initial antidiagonals are:
  0
  1, 1
  2, 4, 2
  3, 8, 8, 3
  4, 13, 16, 13, 4
  5, 19, 27, 27, 19, 5
  6, 26, 40, 46, 40, 26, 6
  7, 34, 56, 69, 69, 56, 34, 7
  8, 43, 74, 98, 104, 98, 74, 43, 8
  9, 53, 95, 130, 149, 149, 130, 95, 53, 9
  10, 64, 118, 168, 198, 214, 198, 168, 118, 64, 10
  ...
		

Crossrefs

This is one of a set of five arrays: A335678, A335679, A335680, A335681, A335682.
For the diagonal see A306302.
See also A114999.

Formula

Euler's formula implies that A335679[m,n] = A335678[m,n] + A335680[m,n] - 1 for all m,n.
Comment from Max Alekseyev, Jun 28 2020 (Start):
T(m,n) = A114999(m-1,n-1) + m*n - 1 for all m, n >= 1. This follows from the Alekseyev-Basova-Zolotykh (2015) article.
Proof: Here is the appropriate modification of the corresponding comment in A306302: Assuming that K(m,n) has vertices at (i,0) and (j,1), for i=0..m-1 and j=0..n-1, the projective map (x,y) -> ((1-y)/(x+1), y/(x+1)) maps K(m,n) to the partition of the right triangle described by Alekseyev et al. (2015), for which Theorem 13 gives the number of regions, line segments, and intersection points. (End)
Max Alekseyev's formula is an analog of Theorem 3 of Griffiths (2010), and gives an explicit formula for this array. - N. J. A. Sloane, Jun 30 2020

A159065 Number of crossings in a regular drawing of the complete bipartite graph K(n,n).

Original entry on oeis.org

0, 1, 7, 27, 65, 147, 261, 461, 737, 1143, 1637, 2349, 3217, 4401, 5769, 7457, 9433, 11945, 14753, 18235, 22173, 26771, 31801, 37813, 44449, 52161, 60489, 69955, 80289, 92203, 104941, 119493, 135261, 152705, 171205, 191649, 213473, 237877
Offset: 1

Views

Author

Stéphane Legendre, Apr 04 2009, Jul 11 2009

Keywords

Examples

			For n = 3 draw vertically 3 points regularly spaced on the right, and 3 points regularly spaced on the left. Join the left and right points by straight lines. These lines cross at c(3) = 7 points.
		

References

  • Umberto Eco, Foucault's Pendulum. San Diego: Harcourt Brace Jovanovich, p. 473, 1989.
  • Athanasius Kircher (1601-1680). Ars Magna Sciendi, In XII Libros Digesta, qua nova et universali Methodo Per Artificiosum Combinationum contextum de omni re proposita plurimis et prope infinitis rationibus disputari, omniumque summaria quaedam cognitio comparari potest, Amstelodami, Apud Joannem Janssonium a Waesberge, et Viduam Elizei Weyerstraet, 1669, fol., pp. 482 (altra ed.: Amstelodami.(ut supra), 1671).

Crossrefs

Programs

  • Maple
    A159065 := proc(n)
        local a,b,c ;
        c := 0 ;
        for a from 1 to n-1 do
        for b from 1 to n-1 do
            if igcd(a,b) = 1 then
                c := c+(n-a)*(n-b) ;
                if 2*a< n and 2*b < n then
                    c := c-(n-2*a)*(n-2*b) ;
                end if;
            end if;
        end do:
        end do:
        c ;
    end proc:
    seq(A159065(n),n=1..30); # R. J. Mathar, Jul 20 2017
  • Mathematica
    a[n_] := Module[{x, y, s1 = 0, s2 = 0}, For[x = 1, x <= n-1, x++, For[y = 1, y <= n-1, y++, If[GCD[x, y] == 1, s1 += (n-x)*(n-y); If[2*x <= n-1 && 2*y <= n-1, s2 += (n-2*x)*(n-2*y)]]]]; s1-s2]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jan 10 2014, translated from Joerg Arndt's PARI code *)
  • PARI
    a(n) = {
        my(s1=0, s2=0);
        for (x=1, n-1,
            for (y=1, n-1,
                if ( gcd(x, y)==1,
                    s1 += (n-x) * (n-y);
                    if ( ( 2*x<=n-1) && (2*y<=n-1),
                        s2 += (n-2*x) * (n-2*y); );
                 );
            );
        );
        return( s1 - s2 );
    }
    \\ Joerg Arndt, Oct 13 2013
    
  • Pascal
    s1:=0; s2:=0;
    for a:=1 to n-1 do
       for b:=1 to n-1 do
          if gcd(a, b)=1 then
          begin
             s1:=s1+(n-a)*(n-b);
             if (2*a<=n-1) and (2*b<=n-1) then
                s2:=s2+(n-2*a)*(n-2*b);
          end;
    a:=s1-s2;
    
  • Python
    from math import gcd
    def a159065(n):
        c=0
        for a in range(1, n):
            for b in range(1, n):
                if gcd(a, b)==1:
                    c+=(n - a)*(n - b)
                    if 2*aIndranil Ghosh, Jul 20 2017
    
  • Python
    from sympy import totient
    def A159065(n): return n-1 if n <= 2 else 2*n-3+3*sum(totient(i)*(n-i)*i for i in range(2,(n+1)//2)) + sum(totient(i)*(n-i)*(2*n-i) for i in range((n+1)//2,n)) # Chai Wah Wu, Aug 16 2021

Formula

a(n) = Sum((n-a)*(n-b); 1<=a
a(n) = (9/(8*Pi^2))*n^4 + O(n^3 log(n)). Asymptotic to (9/(2*Pi^2))*A000537(n-1).
For n > 2: a(n) = A115004(n-1)-(n-2)^2-2*Sum{n=2..floor((n-1)/2)} (n-2i)*(n-i)*phi(i) = 2n-3+3*Sum{n=2..floor((n-1)/2)}(n-i)*i*phi(i) + Sum_{n=floor((n+1)/2)..n-1} (n-i)*(2n-i)*phi(i). - Chai Wah Wu, Aug 16 2021

A320541 Triangle read by rows: T(n,k) (1<=k<=n) = Sum_{i=1..n, j=1..k, gcd(i,j)=1} (n+1-i)*(k+1-j).

Original entry on oeis.org

1, 3, 8, 6, 16, 31, 10, 26, 50, 80, 15, 39, 75, 120, 179, 21, 54, 103, 164, 244, 332, 28, 72, 137, 218, 324, 441, 585, 36, 92, 175, 278, 413, 562, 745, 948, 45, 115, 218, 346, 514, 699, 926, 1178, 1463, 55, 140, 265, 420, 623, 846, 1120, 1424, 1768, 2136
Offset: 1

Author

Hugo Pfoertner, Oct 15 2018

Keywords

Comments

T(n,k) = (1/4) * number of ways to select 3 distinct points forming a triangle of unsigned area = 1/2 from a rectangle of grid points with side lengths n and k.
Permutations of the 3 points are not counted separately.

Examples

			The triangle begins:
   1
   3   8
   6  16   31
  10  26   50   80
  15  39   75  120  179
  21  54  103  164  244  332
  28  72  137  218  324  441 585
...
a(1) = 1 because 4 triangles of area 1/2 in a [0 1]X[0 1] square can be formed by cutting the unit square into 2 triangles along the diagonals.
		

Crossrefs

Cf. A000217, A115004 (main diagonal), A320539, A320543, A333292.
This triangle is equivalent to the table in A114999.

Programs

  • Maple
    T := proc(m,n) local a,i,j; a:=0;
    for i from 1 to m do for j from 1 to n do
    if gcd(i,j)=1 then a:=a+(m+1-i)*(n+1-j); fi; od: od: a; end;
    for m from 1 to 12 do lprint([seq(T(m,n),n=1..m)]); od: # N. J. A. Sloane, Feb 04 2020

Extensions

Replaced definition (now a comment) by explicit formula. - N. J. A. Sloane, Feb 04 2020

A335679 Array read by antidiagonals: T(m,n) (m>=1, n>=1) = number of edges in figure formed by taking m equally spaced points on a line and n equally spaced points on a parallel line, and joining each of the m points to each of the n points by a line segment.

Original entry on oeis.org

1, 3, 3, 5, 8, 5, 7, 15, 15, 7, 9, 24, 28, 24, 9, 11, 35, 47, 47, 35, 11, 13, 48, 69, 80, 69, 48, 13, 15, 63, 97, 119, 119, 97, 63, 15, 17, 80, 128, 170, 178, 170, 128, 80, 17, 19, 99, 165, 225, 257, 257, 225, 165, 99, 19, 21, 120, 205, 292, 340, 372, 340, 292, 205, 120, 21
Offset: 1

Author

Keywords

Comments

The case m=n (the main diagonal) is dealt with in A331757. A306302 has illustrations for the diagonal case for m = 1 to 15.
Also A335678 has colored illustrations for many values of m and n.

Examples

			The initial rows of the array are:
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, ...
3, 8, 15, 24, 35, 48, 63, 80, 99, 120, 143, 168, ...
5, 15, 28, 47, 69, 97, 128, 165, 205, 251, 300, 355, ...
7, 24, 47, 80, 119, 170, 225, 292, 365, 448, 537, 638, ...
9, 35, 69, 119, 178, 257, 340, 443, 555, 683, 819, 975, ...
11, 48, 97, 170, 257, 372, 493, 644, 809, 998, 1197, 1426, ...
13, 63, 128, 225, 340, 493, 654, 857, 1078, 1331, 1595, 1901, ...
15, 80, 165, 292, 443, 644, 857, 1124, 1415, 1748, 2095, 2498, ...
17, 99, 205, 365, 555, 809, 1078, 1415, 1782, 2203, 2640, 3149, ...
19, 120, 251, 448, 683, 998, 1331, 1748, 2203, 2724, 3265, 3896, ...
21, 143, 300, 537, 819, 1197, 1595, 2095, 2640, 3265, 3914, 4673, ...
...
The initial antidiagonals are:
1
3, 3
5, 8, 5
7, 15, 15, 7
9, 24, 28, 24, 9
11, 35, 47, 47, 35, 11
13, 48, 69, 80, 69, 48, 13
15, 63, 97, 119, 119, 97, 63, 15
17, 80, 128, 170, 178, 170, 128, 80, 17
19, 99, 165, 225, 257, 257, 225, 165, 99, 19
21, 120, 205, 292, 340, 372, 340, 292, 205, 120, 21
23, 143, 251, 365, 443, 493, 493, 443, 365, 251, 143, 23
...
		

Crossrefs

This is one of a set of five arrays: A335678, A335679, A335680, A335681, A335682.
For the diagonal case see A306302 and A331757.

Formula

Comment from Max Alekseyev, Jun 28 2020 (Start):
T(m,n) = 2*A114999(m-1,n-1) - A331762(m-1,n-1) + m*n + m + n - 2 for all m, n >= 1. This follows from the Alekseyev-Basova-Zolotykh (2015) article.
Proof: Here is the appropriate modification of the corresponding comment in A306302: Assuming that K(m,n) has vertices at (i,0) and (j,1), for i=0..m-1 and j=0..n-1, the projective map (x,y) -> ((1-y)/(x+1), y/(x+1)) maps K(m,n) to the partition of the right triangle described by Alekseyev et al. (2015), for which Theorem 13 gives the number of regions, line segments, and intersection points. (End)

A335680 Array read by antidiagonals: T(m,n) (m>=1, n>=1) = number of vertices in figure formed by taking m equally spaced points on a line and n equally spaced points on a parallel line, and joining each of the m points to each of the n points by a line segment.

Original entry on oeis.org

2, 3, 3, 4, 5, 4, 5, 8, 8, 5, 6, 12, 13, 12, 6, 7, 17, 21, 21, 17, 7, 8, 23, 30, 35, 30, 23, 8, 9, 30, 42, 51, 51, 42, 30, 9, 10, 38, 55, 73, 75, 73, 55, 38, 10, 11, 47, 71, 96, 109, 109, 96, 71, 47, 11, 12, 57, 88, 125, 143, 159, 143, 125, 88, 57, 12, 13, 68, 108, 156, 187, 209, 209, 187, 156, 108, 68, 13
Offset: 1

Author

Keywords

Comments

The case m=n (the main diagonal) is dealt with in A331755. A306302 has illustrations for the diagonal case for m = 1 to 15.
Also A335678 has colored illustrations for many values of m and n.

Examples

			The initial rows of the array are:
  2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ...
  3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80, ...
  4, 8, 13, 21, 30, 42, 55, 71, 88, 108, 129, 153, ...
  5, 12, 21, 35, 51, 73, 96, 125, 156, 192, 230, 274, ...
  6, 17, 30, 51, 75, 109, 143, 187, 234, 289, 346, 413, ...
  7, 23, 42, 73, 109, 159, 209, 274, 344, 426, 510, 609, ...
  8, 30, 55, 96, 143, 209, 275, 362, 455, 564, 674, 805, ...
  9, 38, 71, 125, 187, 274, 362, 477, 600, 744, 889, 1062, ...
  10, 47, 88, 156, 234, 344, 455, 600, 755, 937, 1119, 1337, ...
  11, 57, 108, 192, 289, 426, 564, 744, 937, 1163, 1389, 1660, ...
  12, 68, 129, 230, 346, 510, 674, 889, 1119, 1389, 1659, 1984, ...
  ...
The initial antidiagonals are:
  2
  3, 3
  4, 5, 4
  5, 8, 8, 5
  6, 12, 13, 12, 6
  7, 17, 21, 21, 17, 7
  8, 23, 30, 35, 30, 23, 8
  9, 30, 42, 51, 51, 42, 30, 9
  10, 38, 55, 73, 75, 73, 55, 38, 10
  11, 47, 71, 96, 109, 109, 96, 71, 47, 11
  12, 57, 88, 125, 143, 159, 143, 125, 88, 57, 12
  ...
		

Crossrefs

This is one of a set of five arrays: A335678, A335679, A335680, A335681, A335682.
For the diagonal case see A306302 and A331755.

Formula

Comment from Max Alekseyev, Jun 28 2020 (Start):
T(m,n) = A114999(m-1,n-1) - A331762(m-1,n-1) + m + n for all m, n >= 1. This follows from the Alekseyev-Basova-Zolotykh (2015) article.
Proof: Here is the appropriate modification of the corresponding comment in A306302: Assuming that K(m,n) has vertices at (i,0) and (j,1), for i=0..m-1 and j=0..n-1, the projective map (x,y) -> ((1-y)/(x+1), y/(x+1)) maps K(m,n) to the partition of the right triangle described by Alekseyev et al. (2015), for which Theorem 13 gives the number of regions, line segments, and intersection points. (End)
Max Alekseyev's formula is an analog of Proposition 9 of Legendre (2009), and gives an explicit formula for this array. - N. J. A. Sloane, Jun 30 2020

A115009 Array read by antidiagonals: let V(m,n) = Sum_{i=1..m, j=1..n, gcd(i,j)=1} (m+1-i)*(n+1-j), then T(m,n) = 2*m*n+m+n+2*V(m,n), for m >= 0, n >= 0.

Original entry on oeis.org

0, 1, 1, 2, 6, 2, 3, 13, 13, 3, 4, 22, 28, 22, 4, 5, 33, 49, 49, 33, 5, 6, 46, 74, 86, 74, 46, 6, 7, 61, 105, 131, 131, 105, 61, 7, 8, 78, 140, 188, 200, 188, 140, 78, 8, 9, 97, 181, 251, 289, 289, 251, 181, 97, 9, 10, 118, 226, 326, 386, 418, 386, 326, 226, 118, 10, 11, 141, 277
Offset: 0

Author

N. J. A. Sloane, Feb 24 2006

Keywords

Comments

This is the number of linear partitions of an m X n grid.

Examples

			The array begins:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
1, 6, 13, 22, 33, 46, 61, 78, 97, 118, ...
2, 13, 28, 49, 74, 105, 140, 181, 226, 277, ...
3, 22, 49, 86, 131, 188, 251, 326, 409, 502, ...
4, 33, 74, 131, 200, 289, 386, 503, 632, 777, ...
5, 46, 105, 188, 289, 418, 559, 730, 919, 1132, ...
6, 61, 140, 251, 386, 559, 748, 979, 1234, 1521, ...
7, 78, 181, 326, 503, 730, 979, 1282, 1617, 1994, ...
...
		

References

  • D. M. Acketa, J. D. Zunic: On the number of linear partitions of the (m,n)-grid. Inform. Process. Lett., 38 (3) (1991), 163-168. See Table A.1.
  • Jovisa Zunic, Note on the number of two-dimensional threshold functions, SIAM J. Discrete Math. Vol. 25 (2011), No. 3, pp. 1266-1268. See Equation (1.2).

Crossrefs

The second and third rows are A028872 and A358296.
The main diagonal is A141255 = A114043 - 1.
The lower triangle is A332351.

Programs

  • Maple
    V:=proc(m,n) local t1,i,j; t1:=0; for i from 1 to m do for j from 1 to n do if gcd(i,j)=1 then t1:=t1+(m+1-i)*(n+1-j); fi; od; od; t1; end; T:=(m,n)->(2*m*n+m+n+2*V(m,n));
  • Mathematica
    V[m_, n_] := Sum[If[GCD[i, j] == 1, (m-i+1)*(n-j+1), 0], {i, 1, m}, {j, 1, n}]; T[m_, n_] := 2*m*n+m+n+2*V[m, n]; Table[T[m-n, n], {m, 0, 11}, {n, 0, m}] // Flatten (* Jean-François Alcover, Jan 08 2014 *)

A331762 Triangle read by rows: T(n,k) (1 <= k <= n) = Sum_{i=1..n, j=1..k, gcd(i,j)=2} (n+1-i)*(k+1-j).

Original entry on oeis.org

0, 0, 1, 0, 2, 4, 0, 4, 8, 15, 0, 6, 12, 22, 32, 0, 9, 18, 33, 48, 71, 0, 12, 24, 44, 64, 94, 124, 0, 16, 32, 58, 84, 123, 162, 211, 0, 20, 40, 72, 104, 152, 200, 260, 320, 0, 25, 50, 90, 130, 190, 250, 325, 400, 499
Offset: 1

Author

N. J. A. Sloane, Feb 04 2020

Keywords

Examples

			Triangle begins:
  0;
  0,  1;
  0,  2,  4;
  0,  4,  8,  15;
  0,  6, 12,  22,  32;
  0,  9, 18,  33,  48,  71;
  0, 12, 24,  44,  64,  94, 124;
  0, 16, 32,  58,  84, 123, 162, 211;
  0, 20, 40,  72, 104, 152, 200, 260, 320;
  0, 25, 50,  90, 130, 190, 250, 325, 400, 499;
  0, 30, 60, 108, 156, 228, 300, 390, 480, 598, 716;
  ...
		

Crossrefs

The main diagonal is A331761.
See A335683 for another version.

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;
    for m from 1 to 12 do
    lprint([seq(V(m,n,2),n=1..m)]); od:
  • Mathematica
    Table[Sum[Boole[GCD[i, j] == 2] (n + 1 - i) (k + 1 - j), {i, n}, {j, k}], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Feb 04 2020 *)
Showing 1-10 of 11 results. Next