login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A259573 Number of distinct differences in row n of the reciprocity array of 0. 3

%I #9 Nov 30 2021 13:27:22

%S 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,

%T 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,

%U 6,13,12,9,14,3,12,9,14,3,18,3,6,13,12,9,16

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

%C 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).

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

%H Antti Karttunen, <a href="/A259573/b259573.txt">Table of n, a(n) for n = 1..20000</a>

%e 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

%t x = 0; s[m_, n_] := Sum[Floor[(n*k + x)/m], {k, 0, m - 1}];

%t t[m_] := Table[s[m, n], {n, 1, 1000}];

%t u = Table[Length[Union[Differences[t[m]]]], {m, 1, 120}] (* A259573 *)

%o (PARI)

%o A259572(m,n) = ((m*n - m - n + gcd(m,n))/2); \\ After _Witold Dlugosz_'s formula for A259572.

%o A259573(n) = #Set(vector(n,k,A259572(n,1+k)-A259572(n,k))); \\ _Antti Karttunen_, Nov 30 2021

%Y Cf. A249572, A259574.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Jun 30 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 04:12 EDT 2024. Contains 372317 sequences. (Running on oeis4.)