OFFSET
1,1
COMMENTS
Terms expressible in more than one way include
13 = 11^1 + 2*1 = 3^2 + 2*2
349 = 347^1 + 2*1 = 7^3 + 2*3
78139 = 78137^^1 + 2*1 = 5^7 + 2*7
1092733 = 1092731^1 + 2*1 = 103^3 + 2*3
22665193 = 22665191^1 + 2*1 = 283^3 + 2*3.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 29 is a term because 29 = 5^2 + 2*2. and 5 and 29 are primes.
MAPLE
N:= 1000: # for terms <= N
S:= {}:
for n from 1 while 3^n + 2*n <= N do
p:= 2:
do
p:= nextprime(p);
q:= p^n + 2*n;
if q > N then break fi;
if isprime(q) then S:= S union {q};
fi
od od:
sort(convert(S, list));
MATHEMATICA
Block[{nn = 1610, a = {}}, Do[Do[Which[# > nn, Break[], PrimeQ[#], AppendTo[a, #]] &[(#^k) + 2 k], {k, Infinity}] &[Prime@ i], {i, 2, PrimePi@ nn}]; Union@ a] (* Michael De Vlieger, Dec 13 2020 *)
PROG
(PARI) isok(p) = {if (isprime(p), for(k=1, p\2, if (k==isprimepower(p-2*k), return(1)); ); ); } \\ Michel Marcus, Dec 13 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 13 2020
STATUS
approved