login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A172183
a(n) is the smallest prime of the form p^q+n, where p and q are prime, or zero if no such prime exists.
0
5, 11, 7, 13, 13, 31, 11, 17, 13, 19, 19, 37, 17, 23, 19, 41, 8209, 43, 23, 29, 29, 31, 31, 73, 29, 53, 31, 37, 37, 79, 0, 41, 37, 43, 43, 61, 41, 47, 43, 67, 73, 67, 47, 53, 53, 71, 79, 73, 53, 59, 59, 61, 61, 79, 59, 83, 61, 67, 67, 109, 0, 71, 67, 73, 73, 191, 71, 193, 73, 79
OFFSET
1,1
COMMENTS
If n mod 6 = 1, both p and q must be 2, and a(n)=0 if n + 4 is not a prime. The values of a(n) for n=257,297,353,383,557 are either greater than 176 000 or 0. Several large entries: a(87) = 2^25633 + 87, a(717) = 2^3217 + 717, a(773) = 2^2539 + 773, a(927) = 2^1117 + 927.
EXAMPLE
a(1)=5 because 5=2^2+1 is the smallest prime of the form p^q+1. a(2)=11 because 11=3^2+2. a(3)=7, because 7=2^2+3. a(17)=8209, because 8209=2^13+17. a(31)=0, because p^q+31 cannot be a prime.
MATHEMATICA
For[l = {}; n = 1, n <= 70, n++, found = False; If[Mod[n, 2] == 0, For[rm = Infinity; i = 1, i < 100, i++, For[j = 1, j < 100, j++, p = Prime[i]; q = Prime[j]; r = p^q + n; If[r >= rm, Break[], If[PrimeQ[r], rm = r; found = True]]; ]; ], (* if n is odd, r=2^q+n *) If[Mod[n, 6] == 1, r = 4 + n; If[PrimeQ[r], found = True], For[j = 1, j < 1000, j++, q = Prime[j]; r = 2^q + n; If[PrimeQ[r], found = True; rm = r; Break[]]; ]; ]; ]; If[ ! found, rm = 0]; l = Append[l, rm]; ]; l
KEYWORD
nonn
AUTHOR
Cheng Zhang (cz1(AT)rice.edu), Jan 28 2010, Mar 02 2010
STATUS
approved