OFFSET
1,2
COMMENTS
The "reciprocity law" that Sum{[(n*k+x)/m] : k = 0..m} = Sum{[(m*k+x)/n] : k = 0..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).
REFERENCES
R. L. Graham, D. E. Knuth, O. Patashnik, Concrete Mathematics, Addison-Wesley, 1989, pages 90-94.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
EXAMPLE
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
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 *)
PROG
(PARI)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 30 2015
STATUS
approved