login
A338820
a(n) = Sum_{i=1..n-1} (prime(i)^2 mod prime(n)).
3
0, 1, 8, 10, 21, 39, 54, 58, 61, 135, 134, 213, 217, 259, 267, 449, 413, 530, 645, 471, 661, 734, 741, 1029, 1194, 1257, 1219, 1434, 1372, 1456, 1547, 1939, 2007, 1987, 2471, 2319, 2802, 2610, 2564, 3334, 3548, 3684, 3612, 3576, 4399, 3686, 5071, 4810, 4647, 5066, 6035, 5213, 5890, 6335, 6327
OFFSET
1,3
COMMENTS
The sequence is not monotone, and not one-to-one: a(95)=a(97)=23038.
LINKS
EXAMPLE
The first three primes are 2, 3, 5, so a(3) = (2^2 mod 5) + (3^2 mod 5) = 4 + 4 = 8.
MAPLE
P:= [seq(ithprime(i), i=1..100)]:
seq(add(P[i]^2 mod P[n], i=1..n-1), n=1..100);
PROG
(PARI) a(n) = my(p=prime(n)); sum(i=1, n-1, lift(Mod(prime(i), p)^2)); \\ Michel Marcus, Nov 11 2020
CROSSREFS
Sequence in context: A300022 A346783 A073619 * A302429 A292999 A374111
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 10 2020
STATUS
approved