OFFSET
1,2
LINKS
Gheorghe Coserea, Table of n, a(n) for n = 1..20000
Tsz Ho Chan, Product of a number and its multiplicative inverse, moments of L-functions and exponential sums, Integers, 16 (2016), #A2.
MAPLE
f:=proc(n) local p, a, b, s;
p:=ithprime(n); s:=0;
for a from 1 to p-1 do
for b from 1 to p-1 do
if (a*b mod p) = 1 then s:=s+a*b; fi;
od: od:
s; end;
[seq(f(n), n=1..40)];
PROG
(PARI) a(n) = { my(p = prime(n)); sum(i = 1, p-1, i*lift(Mod(i, p)^(-1))); }
vector(33, n, a(n)) \\ Gheorghe Coserea, May 16 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 10 2016
STATUS
approved