OFFSET
1,1
COMMENTS
If n = (q^2-1)/2 + k*(q^2-q) for some odd prime q and integer k, then the only possible p is q, as otherwise q | p^n + 2*n. Conjecture: these are the only cases where a(n) = -1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..400
EXAMPLE
a(5) = 13 because 13^5 + 2*5 = 371303 is prime, and no smaller prime than 13 works.
MAPLE
N:= 100: # for a(1) to a(N)
V:= Vector(N):
q:=3:
do
k0:= (q^2-1)/2;
if k0 > N then break fi;
for k from k0 to N by q^2-q do
v:= q^k + 2*k; if isprime(v) then V[k]:= q; else V[k]:= -1 fi;
od;
q:= nextprime(q);
od:
for k from 1 to N do
if V[k] <> 0 then next fi;
p:= 1:
do
p:= nextprime(p);
v:= p^k + 2*k;
if isprime(v) then V[k]:= p; break fi;
od od:
convert(V, list);
CROSSREFS
KEYWORD
sign
AUTHOR
Robert Israel, Jun 22 2023
STATUS
approved