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.

A051800 Numbers k such that 1 plus twice the product of the first k primes is also a prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 18, 23, 26, 30, 80, 120, 148, 220, 395, 776, 884, 977, 3535, 3927
Offset: 1

Views

Author

Labos Elemer, Dec 20 1999

Keywords

Examples

			5 is in the sequence because 2*(2*3*5*7*11) + 1 = 4621 is prime.
		

Crossrefs

2*A002110(n)+1 is prime. Cf. A051887, A051915.

Programs

  • Mathematica
    Position[2#+1&/@FoldList[Times,Prime[Range[800]]],?PrimeQ]//Flatten (* _Harvey P. Dale, Oct 09 2018 *)
  • PARI
    isok(k) = isprime(1+2*prod(j=1, k, prime(j))); \\ Michel Marcus, May 28 2018
    
  • Python
    from sympy import isprime, nextprime
    def afind(limit):
        p, primorialk = 2, 2
        for k in range(1, limit+1):
            if isprime(2*primorialk + 1):
                print(k, end=", ")
            p = nextprime(p)
            primorialk *= p
    afind(400) # Michael S. Branicky, Dec 24 2021

Extensions

More terms from Harvey P. Dale, Oct 09 2018
a(17)-a(18) from Michael S. Branicky, Dec 24 2021
a(19)-a(20) from Michael S. Branicky, May 30 2023