[go: up one dir, main page]

login
A259574
Sum of numbers in the n-th antidiagonal of the reciprocity array of 0.
4
0, 1, 4, 11, 22, 42, 66, 104, 150, 211, 280, 377, 474, 604, 750, 916, 1096, 1323, 1548, 1831, 2122, 2446, 2794, 3212, 3620, 4087, 4590, 5141, 5698, 6360, 6990, 7728, 8484, 9289, 10156, 11091, 12006, 13042, 14122, 15280, 16420, 17727, 18984, 20401, 21852
OFFSET
1,3
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). See A259575 for a guide to related sequences.
REFERENCES
R. L. Graham, D. E. Knuth, O. Patashnik, Concrete Mathematics, Addison-Wesley, 1989, pages 90-94.
LINKS
FORMULA
a(n) = Sum{m=1..n, Sum(k=0..m-1, floor(n*k/m)).
MAPLE
seq(add(add(floor(n*k/m), k=0..m-1), m=1..n), n=1..100); # Robert Israel, Jul 06 2015
MATHEMATICA
f[n_] := Sum[Floor[n*k/m], {m, n}, {k, 0, m - 1}]; Array[f, 50]
PROG
(PARI) a(n) = {r=0; for(m=1, n, for(k=0, m-1, r=r+floor((n*k)/m))); return(r); } main(size)={return(vector(size, n, a(n))); } /* Anders Hellström, Jul 07 2015 */
CROSSREFS
Sequence in context: A177853 A008016 A295957 * A008249 A376717 A174405
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 30 2015
STATUS
approved