Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #15 Apr 25 2019 03:57:13
%S 1,5,29,83,351,519,1291,1747,3357,6553,7501,11839,17219,19263,28199,
%T 38583,56049,49043,74771,96133,89059,132087,155209,185653,221741,
%U 260983,274803,331913,314355,348943,482091,569587,641707
%N Sum_{ i in 1..p-1, j in 1..p-1, i*j mod p = 1} i*j, where p = n-th prime.
%H Gheorghe Coserea, <a href="/A272650/b272650.txt">Table of n, a(n) for n = 1..20000</a>
%H Tsz Ho Chan, <a href="https://www.emis.de/journals/INTEGERS/papers/q2/q2.Abstract.html">Product of a number and its multiplicative inverse, moments of L-functions and exponential sums</a>, Integers, 16 (2016), #A2.
%p f:=proc(n) local p,a,b,s;
%p p:=ithprime(n); s:=0;
%p for a from 1 to p-1 do
%p for b from 1 to p-1 do
%p if (a*b mod p) = 1 then s:=s+a*b; fi;
%p od: od:
%p s; end;
%p [seq(f(n),n=1..40)];
%o (PARI) a(n) = { my(p = prime(n)); sum(i = 1, p-1, i*lift(Mod(i,p)^(-1))); }
%o vector(33, n, a(n)) \\ _Gheorghe Coserea_, May 16 2016
%K nonn
%O 1,2
%A _N. J. A. Sloane_, May 10 2016