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.

A367966 Smallest Sophie Germain prime >= 2^n.

Original entry on oeis.org

2, 2, 5, 11, 23, 41, 83, 131, 281, 593, 1031, 2063, 4211, 8243, 16421, 32771, 65633, 131321, 262193, 524351, 1048889, 2097629, 4194581, 8388953, 16777259, 33554771, 67108913, 134218433, 268435631, 536871311, 1073741891, 2147483693, 4294967681, 8589934631, 17179869659
Offset: 0

Views

Author

Andrei Lapets, Dec 06 2023

Keywords

Examples

			For n = 0, a(0) = 2 because 2 is prime, 2*(2) + 1 = 5 is prime, 2 >= 2^0 where 2^0 = 1, and 1 is not prime.
For n = 1, a(1) = 2 because 2 is prime, 2*(2) + 1 = 5 is prime, 2 >= 2^1 where 2^1 = 2.
For n = 2, a(2) = 5 because 5 is prime, 2*(5) + 1 = 11 is prime, 5 >= 2^2 where 2^2 = 4, and 4 is not prime.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local p; for p from 2^n
          while not andmap(isprime, [p, 2*p+1]) do od; p
        end:
    seq(a(n), n=0..44);  # Alois P. Heinz, Dec 13 2023
  • Mathematica
    a={}; nmax=35; For[n=0, n<=nmax, n++, k=2^n; While[!PrimeQ[k] || !PrimeQ[2k+1], k++]; AppendTo[a,k]]; a (* Stefano Spezia, Dec 10 2023 *)
  • PARI
    a(n) = forprime(p=2^n, , if (isprime(2*p+1), return(p))); \\ Michel Marcus, Dec 12 2023

Formula

Apparently a(n) = (A111671(n) - 1)/2 for n>=2. - Hugo Pfoertner, Dec 13 2023