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.

A123252 a(n) = smallest prime of the form 2^k + 2n - 1, k = 0, 1, ..., or 0 if there is none.

Original entry on oeis.org

3, 5, 7, 11, 11, 13, 17, 17, 19, 23, 23, 31, 29, 29, 31, 47, 37, 37, 41, 41, 43, 47, 47, 79, 53, 53, 61, 59, 59, 61, 317, 67, 67, 71, 71, 73, 89, 79, 79, 83, 83, 211, 89, 89, 97, 107, 97, 97, 101, 101, 103, 107, 107, 109, 113, 113, 241, 131, 149, 127, 137, 127, 127, 131
Offset: 1

Views

Author

Cino Hilliard, Oct 08 2006

Keywords

Comments

If n == 0 (mod 3) then the exponent k must be odd, if n>1 and n == 1 (mod 3) then k must be even and if n == 2 (mod 3) then k can be either.
Records: 3, 5, 7, 11, 13, 17, 19, 23, 31, 47, 79, 317, 1163, 1048847, 536871199, 2^955 + 773, ..., . - Robert G. Wilson v

Examples

			For n = 4, p = 2 -> 2^2+(2*4-1) = 11, the fourth entry because 2^1+(2*4-1) which equals 9 is not a prime.
		

Crossrefs

Cf. A067760.

Programs

  • Mathematica
    f[n_] := Block[{p = 1}, While[ !PrimeQ[2^p + 2n - 1], p++ ]; 2^p + 2n - 1]; Array[f, 64] (* Robert G. Wilson v *)
  • PARI
    g2(n) = forstep(k=1,n,2,for(p=1,n,y=k+2^p;if(isprime(y),print1(y",");break)))

Formula

a(n) = 2^A067760(n-1) + 2n-1 if A067760(n-1) > 0, 0 if A067760(n-1) = 0. - Robert Israel, Jan 14 2017

Extensions

Edited and extended by Robert G. Wilson v, Nov 11 2006
Name edited by Robert Israel, Jan 14 2017