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

Numbers k such that prime(k)^prime(k+1) == prime(k+3) (mod prime(k+2)).
2

%I #21 Jan 27 2021 15:47:52

%S 15,52,701,26017,579994,1131833

%N Numbers k such that prime(k)^prime(k+1) == prime(k+3) (mod prime(k+2)).

%C For prime(k)^prime(k+1) == prime(k+2) (mod prime(k+3)), the first two examples are k = 942 and k = 4658911.

%e Primes number 52 to 55 are 239, 241, 251, 257, and 239^241 == 257 == 6 (mod 251), so 52 is in the sequence.

%p q:= 2: r:= 3: s:= 5: R:= NULL: count:= 0:

%p for k from 1 while count < 6 do

%p p:= q; q:= r; r:= s; s:= nextprime(s);

%p if p &^ q - s mod r = 0 then count:= count+1; R:= R, k fi

%p od:

%p R;

%o (Python)

%o from sympy import nextprime

%o k,p,q,r,s,A340868_list = 1,2,3,5,7,[]

%o while k < 10**7:

%o if pow(p,q,r) == s % r:

%o A340868_list.append(k)

%o k,p,q,r,s = k+1,q,r,s,nextprime(s) # _Chai Wah Wu_, Jan 25 2021

%Y Cf. A340876.

%K nonn,more

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 24 2021