OFFSET
0,5
COMMENTS
For a given n a(n) is the sum for h ranging over the set of least nonnegative residues coprimes with n of (hh'-1)/n, where h' is the (unique) number in the same set such that hh'=1 (mod n).
The summand is also the least nonnegative residue of (-1/n) mod h. - Robert Israel, May 18 2014
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
M. Dondi, Plot of A074639(n)/phi(n) (Euler's totient function) against the line y=x/4 in the range [0,100].
M. Dondi, Plot of A074639(n)/phi(n) (Euler's totient function) against the line y=x/4 in the range [0,1000].
M. Dondi, Plot of A074639(n)/phi(n) (Euler's totient function) against the line y=x/4 in the range [0,10000].
M. Dondi, Plot of A074639(n)/phi(n) (Euler's totient function) against the line y=x/4 in the range [0,10000] showing only one point out of every 5.
EXAMPLE
(1,n)=1 for all n, 1*1=1, so 1 contributes 0 to the sum. (n-1,n)=1 for all n, (n-1)^2=1 (mod n), so n-1 contributes n-2. Thus a(6)=4, in fact only 1 and 5 are coprime with 6 in {1,...,6}; a(5)=2*1+(5-2), in fact 2*3=6=1 (mod 5) and 6=5+1.
MAPLE
seq(add((i*(i^(-1) mod m)-1)/m, i = select(t -> igcd(t, m)=1, [$1..m-1])), m=0..100); # Robert Israel, May 18 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michele Dondi (bik.mido(AT)tiscalinet.it), Sep 12 2002
STATUS
approved