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.

Showing 1-4 of 4 results.

A051888 a(n) is the smallest prime p such that p*n! + 1 is prime.

Original entry on oeis.org

2, 2, 2, 2, 3, 2, 3, 3, 7, 3, 3, 5, 2, 3, 13, 7, 31, 5, 2, 7, 17, 67, 41, 3, 13, 3, 43, 17, 97, 7, 29, 109, 3, 71, 5, 2, 7, 41, 3, 59, 3, 11, 29, 7, 107, 67, 79, 3, 743, 149, 163, 2, 211, 2, 19, 71, 73, 23, 37, 113, 149, 67, 41, 617, 107, 37, 107, 283, 113, 19, 239, 107, 73, 97, 5
Offset: 0

Views

Author

Labos Elemer, Dec 15 1999

Keywords

Comments

Analogous to or subset of A051686; generalization of A005384.
The PFGW program has been used to certify all the primes corresponding to the terms up to a(1000), using a deterministic test which exploits the factorization of a(n) - 1. - Giovanni Resta, May 30 2018

Crossrefs

Programs

  • Mathematica
    Do[k = 1; While[ !PrimeQ[ Prime[k]*n! + 1], k++ ]; Print[ Prime[k]], {n, 1, 75} ]
    spp[n_]:=Module[{p=2,nf=n!},While[!PrimeQ[p*nf+1],p=NextPrime[p]];p]; Array[ spp,80,0] (* Harvey P. Dale, May 17 2019 *)
  • PARI
    a(n) = {my(p=2); while (!isprime(p*n! + 1), p = nextprime(p+1)); p;} \\ Michel Marcus, May 28 2018

Formula

a(n) = (A051901(n)-1)/n!. - Amiram Eldar, Feb 25 2025

Extensions

More terms from James Sellers, Dec 16 1999

A051886 a(n) is the minimal prime p such that 2^n * p + 1 is prime.

Original entry on oeis.org

2, 2, 3, 2, 7, 3, 3, 2, 3, 23, 13, 29, 3, 5, 7, 2, 37, 53, 3, 11, 7, 11, 37, 71, 73, 5, 7, 17, 13, 23, 3, 239, 43, 113, 163, 59, 3, 89, 349, 5, 97, 3, 73, 11, 67, 101, 19, 101, 61, 23, 7, 17, 7, 233, 127, 5, 541, 29, 103, 71, 31, 53, 109, 179, 163, 71, 3, 929, 31, 23, 193, 101
Offset: 0

Views

Author

Labos Elemer, Dec 15 1999

Keywords

Comments

The minimal 2^n - Germain primes in order of increasing exponent n.

Examples

			The 10th term is 13, the first term in 1024-Germain prime sequence: {13,19,37,79,223,...}. The largest prime was found for 2^79: both 1427 and 604462909807314587353088*1427 + 1 = 862568572295037916152856577 are primes.
		

Crossrefs

Programs

  • Mathematica
    Table[p = 2; While[! PrimeQ[2^n*p + 1], p = NextPrime@ p]; p, {n, 0, 71}] (* Michael De Vlieger, Mar 05 2017 *)
  • PARI
    P=10^6;
    default(primelimit,P);
    a(n)={my(N=2^n);forprime(p=2,P,if(isprime(N*p+1),return(p)));}
    vector(66,n,a(n))
    /* Joerg Arndt, Jun 18 2012 */

Formula

a(n) = (A051900(n)-1)/2^n. - Amiram Eldar, Feb 28 2025

Extensions

Better name by Joerg Arndt, Jun 18 2012

A051902 Minimal primorial safe primes: p and primorial*p + 1 are both primes.

Original entry on oeis.org

5, 13, 61, 421, 4621, 150151, 8678671, 106696591, 2454021571, 71166625531, 401120980261, 170676977100631, 2129751844690471, 562558737261811291, 11682905869181336791, 97767475431570134191, 9613801750771063195351, 234576762718813941966541, 55008250857561869391153631
Offset: 1

Views

Author

Labos Elemer, Dec 16 1999

Keywords

Comments

In A051888, 13 of the first 25 values are distinct, while here all corresponding min-primorial-safe-primes are different: {2,5,17,11,23,43,19,3,7,61,53,41,47}.

Examples

			The first five terms of A051887 are 2, so the first 5 terms have the form 1 + 2*A002110(n): 5, 13, 61, 421, 4621, which are smallest terms in A005385, A051644, A051646, A051648, A051649. The 6th term here is A051651(1) = A051887(6)*A002110(6) + 1 = 5*30030 + 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = 2, r =Times @@ Prime[Range[n]]}, While[!PrimeQ[p * r + 1], p = NextPrime[p]]; p * r + 1]; Array[a, 20] (* Amiram Eldar, Feb 25 2025 *)
  • PARI
    a(n) = {my(p = 2, r = vecprod(primes(n))); while(!isprime(p * r + 1), p = nextprime(p+1)); p * r + 1;} \\ Amiram Eldar, Feb 25 2025

Formula

a(n) = 1 + A002110(n)*A051887(n).

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
Showing 1-4 of 4 results.