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.

A259572 Reciprocity array of 0; rectangular, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 2, 3, 2, 0, 0, 2, 3, 3, 2, 0, 0, 3, 4, 6, 4, 3, 0, 0, 3, 6, 6, 6, 6, 3, 0, 0, 4, 6, 8, 10, 8, 6, 4, 0, 0, 4, 7, 9, 10, 10, 9, 7, 4, 0, 0, 5, 9, 12, 12, 15, 12, 12, 9, 5, 0, 0, 5, 9, 12, 14, 15, 15, 14, 12, 9, 5, 0, 0, 6, 10
Offset: 1

Views

Author

Clark Kimberling, Jun 30 2015

Keywords

Comments

The "reciprocity law" that Sum_{k=0..m} [(n*k+x)/m] = Sum_{k=0..n} [(m*k+x)/n] where x is a real number and m and n are positive integers, is proved in Section 3.5 of Concrete Mathematics (see References). For every x, the reciprocity array is symmetric, and the principal diagonal consists primarily of triangular numbers, A000217.
In the following guide, the sequence in column 3 is the number of distinct terms in the difference sequence of row n of the reciprocity array of x; sequence in column 4 is the sum of numbers in the n-th antidiagonal of the array.
x array differences sums

Examples

			Northwest corner:
  0   0   0   0   0   0   0   0   0   0
  0   1   1   2   2   3   3   4   4   5
  0   1   3   3   4   6   6   7   9   9
  0   2   3   6   6   8   9  12  12  14
  0   2   4   6  10  10  12  14  16  20
  0   3   6   8  10  15  15  18  21  23
		

References

  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics, Addison-Wesley, 1989, pages 90-94.

Crossrefs

Programs

  • Mathematica
    x = 0;  s[m_, n_] := Sum[Floor[(n*k + x)/m], {k, 0, m - 1}];
    TableForm[ Table[s[m, n], {m, 1, 15}, {n, 1, 15}]] (* array *)
    u = Table[s[n - k + 1, k], {n, 15}, {k, n, 1, -1}] // Flatten (* sequence *)

Formula

T(m,n) = Sum_{k=0..m-1} [(n*k+x)/m] = Sum_{k=0..n-1} [(m*k+x)/n], where x = 0 and [ ] = floor.
Note that if [x] = [y], then [(n*k+x)/m] = [(n*k+y)/m], so that the reciprocity arrays for x and y are identical in this case.
T(m,n) = (m*n - m - n + gcd(m,n))/2. - Witold Dlugosz, Apr 07 2021

A259573 Number of distinct differences in row n of the reciprocity array of 0.

Original entry on oeis.org

1, 2, 3, 4, 3, 4, 3, 6, 5, 6, 3, 8, 3, 6, 7, 8, 3, 8, 3, 8, 9, 6, 3, 12, 5, 6, 7, 10, 3, 14, 3, 10, 9, 6, 9, 14, 3, 6, 9, 12, 3, 12, 3, 12, 11, 6, 3, 18, 5, 10, 9, 12, 3, 12, 9, 14, 9, 6, 3, 22, 3, 6, 13, 12, 9, 14, 3, 12, 9, 14, 3, 18, 3, 6, 13, 12, 9, 16
Offset: 1

Views

Author

Clark Kimberling, Jun 30 2015

Keywords

Comments

The "reciprocity law" that Sum_{k=0..m} [(n*k+x)/m] = Sum_{k=0..n} [(m*k+x)/n] where x is a real number and m and n are positive integers, is proved in Section 3.5 of Concrete Mathematics (see References).

Examples

			In the array at A259572, row 4 is (0,2,3,6,6,8,9,12,12,14,15,...), with differences (2,1,3,0,2,1,3,0,2,1,3,0, ...), and distinct differences {0,1,2,3}, so that a(4) = 4. Example corrected by _Antti Karttunen_, Nov 30 2021
		

References

  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics, Addison-Wesley, 1989, pages 90-94.

Crossrefs

Programs

  • Mathematica
    x = 0;  s[m_, n_] := Sum[Floor[(n*k + x)/m], {k, 0, m - 1}];
    t[m_] := Table[s[m, n], {n, 1, 1000}];
    u = Table[Length[Union[Differences[t[m]]]], {m, 1, 120}]  (* A259573 *)
  • PARI
    A259572(m,n) = ((m*n - m - n + gcd(m,n))/2); \\ After Witold Dlugosz's formula for A259572.
    A259573(n) = #Set(vector(n,k,A259572(n,1+k)-A259572(n,k))); \\ Antti Karttunen, Nov 30 2021

A259577 Sum of numbers in the n-th antidiagonal of the reciprocity array of 1.

Original entry on oeis.org

1, 2, 6, 13, 26, 44, 72, 108, 156, 215, 290, 381, 486, 610, 758, 924, 1112, 1329, 1566, 1839, 2134, 2456, 2816, 3220, 3640, 4099, 4608, 5153, 5726, 6368, 7020, 7744, 8504, 9305, 10180, 11103, 12042, 13060, 14146, 15296, 16460, 17739, 19026, 20421, 21876
Offset: 1

Views

Author

Clark Kimberling, Jul 01 2015

Keywords

Comments

The "reciprocity law" that Sum_{k=0..m} [(n*k+x)/m] = Sum_{k=0..n} [(m*k+x)/n] where x is a real number and m and n are positive integers, is proved in Section 3.5 of Concrete Mathematics (see References). See A259572 for a guide to related sequences.

References

  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics, Addison-Wesley, 1989, pages 90-94.

Crossrefs

Programs

  • Mathematica
    f[n_] := Sum[Floor[(n*k + 1)/m], {m, n}, {k, 0, m - 1}]; Array[f, 50]
  • PARI
    a(n)=x=1;r=0;for(m=1,n,for(k=0,m-1,r=r+floor((n*k+x)/m)));return(r);
    main(size)=return(vector(size,n,a(n))) \\ Anders Hellström, Jul 06 2015
    
  • PARI
    a(n)=sum(m=1,n, sum(k=0,m-1, (n*k+1)\m)) \\ Charles R Greathouse IV, Mar 22 2017

Formula

a(n) = Sum_{m=1..n} Sum_{k=0..m-1} floor((n*k + x)/m), where x = 1.
a(n) = n^3 / 4 + O(n^2). - Charles R Greathouse IV, Mar 22 2017
Showing 1-3 of 3 results.