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

a(n) = Sum_{i=1..n-1} (prime(i)^2 mod prime(n)).
3

%I #13 Nov 11 2020 11:58:34

%S 0,1,8,10,21,39,54,58,61,135,134,213,217,259,267,449,413,530,645,471,

%T 661,734,741,1029,1194,1257,1219,1434,1372,1456,1547,1939,2007,1987,

%U 2471,2319,2802,2610,2564,3334,3548,3684,3612,3576,4399,3686,5071,4810,4647,5066,6035,5213,5890,6335,6327

%N a(n) = Sum_{i=1..n-1} (prime(i)^2 mod prime(n)).

%C The sequence is not monotone, and not one-to-one: a(95)=a(97)=23038.

%H Robert Israel, <a href="/A338820/b338820.txt">Table of n, a(n) for n = 1..10000</a>

%e The first three primes are 2, 3, 5, so a(3) = (2^2 mod 5) + (3^2 mod 5) = 4 + 4 = 8.

%p P:= [seq(ithprime(i),i=1..100)]:

%p seq(add(P[i]^2 mod P[n],i=1..n-1),n=1..100);

%o (PARI) a(n) = my(p=prime(n)); sum(i=1, n-1, lift(Mod(prime(i), p)^2)); \\ _Michel Marcus_, Nov 11 2020

%Y Cf. A338102, A338821.

%K nonn

%O 1,3

%A _J. M. Bergot_ and _Robert Israel_, Nov 10 2020