OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..560
EXAMPLE
For n = 4, prime(4) = 11, 2^11 = 2048, p2 = 2048-p1 is satisfied at first with prime p1 = 19 resulting in prime p2 = 2029, so a(4) = 19.
For n = 31, prime(31) = 127, p2 = 2^127-p1 is satisfied first with p1 = 577 and p2 = 170141183460469231731687303715884105151, so a(31) = 577.
PROG
(PARI) a(n) = {my(p = 1 << prime(n), q = 2); while(!isprime(p - q), q = nextprime(q + 1)); q; } \\ Amiram Eldar, Feb 18 2025
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, Oct 19 2000
EXTENSIONS
Offset corrected by Amiram Eldar, Feb 18 2025
STATUS
approved