OFFSET
1,1
COMMENTS
a(5) > 1.6*10^11, if it exists. - Amiram Eldar, May 13 2024
The corresponding nextprime(p) for terms in this sequence must be a factor of k*4^k+1 and p=nextprime(p)-2*k . No more terms for k<50. - Harsh Aggarwal, Sep 19 2024
EXAMPLE
3 is a term because 2^3 mod nextprime(3) = 8 mod 5 = 3;
7 is a term because 2^7 mod nextprime(7) = 128 mod 11 = 7;
3499 is a term because 2^3499 mod nextprime(3499) = 2^3499 mod 3511 = 3499;
554849 is a term because 2^554849 mod nextprime(554849) = 2^554849 mod 554887 = 554849.
MAPLE
R:= NULL: q:= 2:
while q < 10^6 do
p:= q: q:= nextprime(p);
if 2 &^ p mod q = p then R:= R, p fi
od:
R; # Robert Israel, May 13 2024
PROG
(Magma) [p: p in PrimesUpTo(10^6) | 2^p mod NextPrime(p) eq p];
(PARI) lista(pmax) = {my(p = 2); forprime(pnext = 3, pmax, if(Mod(2, pnext)^p == p, print1(p, ", ")); p = pnext); } \\ Amiram Eldar, May 13 2024
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Juri-Stepan Gerasimov, May 12 2024
STATUS
approved