OFFSET
1,2
COMMENTS
a(325) > 2^34 if it exists. - Michael S. Branicky, Dec 12 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..324
FORMULA
a(n) = A087985(2^n).
EXAMPLE
a(1) = 0 since 1+(2^1)*p = m*q has no solution p,q a consecutive prime pair.
a(2*s) = 2 since 1+2^(2*s)*p is divisible by q with {p,q} = {2,3}.
a(4*s+3) = 3 since 1+2^(4*s+3)*p is divisible by q with {p,q} = {3,5}.
a(12*s+5) = 5 since 1+2^(12*s+5)*p is divisible by q with {p,q} = {5,7}.
If n == {1, 7, 9} (mod 12) then larger nontrivial solutions exist.
E.g.:
n=37: 2^37 = 137438953472;
a(37) = 61673 = prime(6206) because 1 + 137438953472*61673 = 8476272577478657 = 61681*137421127697, 61681 = prime(6207).
Additional solutions exist for special exponents of 2; e.g., for n == {9, 49} (mod 60), a(n) is usually 29 or occasionally 19.
MATHEMATICA
{k=0, nu=0; sq={}}; Table[Print[{n-1, Min[Prime[sq]]}]; nu=0; sq={}; Do[s=Mod[(2^n)*Prime[x]+1, Prime[x+1]]; If[Equal[s, 0], nu=nu+1; sq=Append[sq, n]], {x, 1, 10000000}], {n, 1, 257}]
PROG
(PARI) a(n)={my(m=2^n); if(n==1, 0, forprime(p=2, oo, if((1 + m*p) % nextprime(p+1)==0, return(p))))} \\ Andrew Howroyd, Dec 11 2021
(Python)
from sympy import nextprime
def a(n):
if n == 1: return 0
p, q, twon = 2, 3, 2**n
while (1 + twon*p)%q: p, q = q, nextprime(q)
return p
print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Dec 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Oct 06 2003
STATUS
approved