login

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”).

A272650
Sum_{ i in 1..p-1, j in 1..p-1, i*j mod p = 1} i*j, where p = n-th prime.
1
1, 5, 29, 83, 351, 519, 1291, 1747, 3357, 6553, 7501, 11839, 17219, 19263, 28199, 38583, 56049, 49043, 74771, 96133, 89059, 132087, 155209, 185653, 221741, 260983, 274803, 331913, 314355, 348943, 482091, 569587, 641707
OFFSET
1,2
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
Sequence in context: A154412 A339935 A236075 * A050409 A111937 A215850
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 10 2016
STATUS
approved