A128898 Primes of form 2^j + 2^k - 1 or 2^j + 2^k + 1.
2, 3, 5, 7, 11, 13, 17, 19, 23, 31, 37, 41, 47, 67, 71, 73, 79, 97, 127, 131, 137, 191, 193, 257, 263, 271, 383, 521, 577, 641, 769, 1031, 1033, 1039, 1087, 1151, 1153, 1279, 2053, 2063, 2081, 2111, 2113, 4099, 4111, 4127, 4129, 4159, 5119, 6143, 8191, 8209
Offset: 1
Keywords
Examples
2^2 + 2^5 + 1 = 4 + 32 + 1 = 37 is prime, hence 37 is a term. 2^4 + 2^5 - 1 = 16 + 32 - 1 = 47 is prime, hence 47 is a term. 2^3 + 2^6 + 1 = 8 + 64 + 1 = 73 is prime, hence 73 is a term.
Links
- Robert Israel, Table of n, a(n) for n = 1..6772
Crossrefs
Programs
-
Maple
sort(convert(select(isprime, {2,seq(seq(seq(2^i+2^j+k,k=[-1,1]),j=1..i),i=1..15)}),list)); # Robert Israel, Jun 13 2018
-
Mathematica
lst = {}; Do[p = 2^a + 2^b; If[PrimeQ[p - 1], AppendTo[lst, p - 1]]; If[PrimeQ[p + 1], AppendTo[lst, p + 1]], {a, 0, 14}, {b, 0, a}]; Union@ lst (* Robert G. Wilson v *)
-
PARI
{m=13; v=[]; for(j=0, m, for(k=j, m, if(isprime(p=2^j+2^k-1), v=concat(v, p)); if(isprime(p=2^j+2^k+1), v=concat(v,p)))); w=Vec(listsort(List(v), 1)); w} /* Klaus Brockhaus, Apr 22 2007 */
Extensions
Edited, corrected and extended by Klaus Brockhaus and Robert G. Wilson v, Apr 22 2007
Comments