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.

A341211 Smallest prime p such that (p^(2^n) + 1)/2 is prime.

Original entry on oeis.org

3, 3, 3, 13, 3, 3, 3, 113, 331, 3631, 827, 3109, 4253, 7487, 71
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 06 2021

Keywords

Comments

Expressions of the form m^j + 1 can be factored (e.g., m^3 + 1 = (m + 1)*(m^2 - m + 1)) for any positive integer j except when j is a power of 2, so (p^j + 1)/2 for prime p cannot be prime unless j is a power of 2.
a(12) <= 4253, a(13) <= 7487, a(14) <= 71. - Daniel Suteu, Feb 07 2021
a(13) > 2500 and a(14) = 71. - Jinyuan Wang, Feb 07 2021

Examples

			No term is smaller than 3 (since 2 is the only smaller prime, and (2^(2^n) + 1)/2 is not an integer).
(3^(2^0) + 1)/2 = (3^1 + 1)/2 = (3 + 1)/2 = 4/2 = 2 is prime, so a(0)=3.
(3^(2^1) + 1)/2 = (3^2 + 1)/2 = 5 is prime, so a(1)=3.
(3^(2^2) + 1)/2 = (3^4 + 1)/2 = 41 is prime, so a(2)=3.
(3^(2^3) + 1)/2 = (3^8 + 1)/2 = 3281 = 17*193 is not prime, nor is (p^8 + 1)/2 for any other prime < 13, but (13^8 + 1)/2 = 407865361 is prime, so a(3)=13.
		

Crossrefs

Cf. A093625 and A171381 (both for when p=3).

Programs

  • Alpertron
    x=3;x=N(x);NOT IsPrime((x^8192+1)/2);N(x)
    # Martin Ehrenstein, Feb 08 2021
    
  • PARI
    a(n) = my(p=3); while (!isprime((p^(2^n) + 1)/2), p=nextprime(p+1)); p; \\ Michel Marcus, Feb 07 2021
    
  • Python
    from sympy import isprime, nextprime
    def a(n):
      p, pow2 = 3, 2**n
      while True:
        if isprime((p**pow2 + 1)//2): return p
        p = nextprime(p)
    print([a(n) for n in range(9)]) # Michael S. Branicky, Mar 03 2021

Extensions

a(11) from Daniel Suteu, Feb 07 2021
a(12) from Jinyuan Wang, Feb 07 2021
a(13)-a(14), using Dario Alpern's integer factorization calculator and prior bounds, from Martin Ehrenstein, Feb 08 2021