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.

A238554 Smallest k such that k + 2^n and k*2^n + 1 are both prime.

Original entry on oeis.org

1, 1, 1, 5, 1, 11, 3, 9, 1, 35, 15, 39, 3, 39, 63, 35, 1, 149, 3, 419, 7, 221, 25, 155, 73, 735, 69, 29, 193, 261, 3, 135, 81, 149, 85, 125, 117, 809, 303, 509, 27, 699, 325, 29, 27, 285, 639, 65, 61, 1911, 639, 165, 295, 1295, 163, 905, 175, 75, 1593, 249
Offset: 0

Views

Author

Keywords

Comments

If a(n) = 1, then the two primes are the same and they are Fermat primes. - Michel Marcus, Mar 01 2014

Examples

			5 is in this sequence because 5 + 2^3 = 13 and 5*2^3 + 1 = 41 are both prime.
		

Crossrefs

Cf. A019434 (Fermat primes).

Programs

  • Mathematica
    Table[Module[{k=1,c=2^n},While[!AllTrue[{c+k,k c+1},PrimeQ],k++];k],{n,0,60}] (* Harvey P. Dale, Oct 20 2023 *)
  • PARI
    a(n) = {k = 1;while (!(isprime(k + 2^n) && isprime(k*2^n + 1)), k++); k;} \\ Michel Marcus, Mar 01 2014

Extensions

a(15) corrected and a(24) from Michel Marcus, Mar 01 2014
Missing term and a(25)-a(59) from Giovanni Resta, Mar 01 2014