cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A128898 Primes of form 2^j + 2^k - 1 or 2^j + 2^k + 1.

Original entry on oeis.org

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

Views

Author

J. M. Bergot, Apr 21 2007

Keywords

Comments

Union of A000668, A081091 and A239712. - Robert Israel, Jun 13 2018

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.
		

Crossrefs

Cf. A000668 (Mersenne primes), A092506 (primes of form 2^n + 1), A070739 (primes of form 2^x+2^y+1), A081091, A239712.

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