A339692 Primes that can be expressed as p^k+2*k where p is prime and k >= 1.
5, 7, 13, 19, 29, 31, 43, 53, 61, 73, 89, 103, 109, 131, 139, 151, 173, 181, 193, 199, 229, 241, 271, 283, 293, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1373, 1429, 1453, 1483, 1489, 1609
Offset: 1
Keywords
Examples
a(5) = 29 is a term because 29 = 5^2 + 2*2. and 5 and 29 are primes.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
PARI
isok(p) = {if (isprime(p), for(k=1, p\2, if (k==isprimepower(p-2*k), return(1));););} \\ Michel Marcus, Dec 13 2020
Comments