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-5 of 5 results.

A057704 Primorial - 1 prime indices: integers m such that the m-th primorial minus 1 is prime.

Original entry on oeis.org

2, 3, 5, 6, 13, 24, 66, 68, 167, 287, 310, 352, 564, 590, 620, 849, 1552, 1849, 67132, 85586, 234725, 334023, 435582, 446895
Offset: 1

Views

Author

Labos Elemer, Oct 24 2000

Keywords

Comments

There are two versions of "primorial": this is using the definition in A002110. - Robert Israel, Dec 30 2014
As of 28 February 2012, the largest known primorial prime is A002110(85586) - 1 with 476311 digits, found by the PrimeGrid project (see link). - Dmitry Kamenetsky, Aug 11 2015

Examples

			The 6th primorial is A002110(6) = 2*3*5*7*11*13 = 30030, and 30030 - 1 = 30029 is a prime, so 6 is in the sequence.
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 114.

Crossrefs

Cf. A006794 (Primorial -1 primes: Primes p such that -1 + product of primes up to p is prime).

Programs

  • Maple
    P:= 1:
    p:= 1:
    count:= 0:
    for n from 1 to 1000 do
      p:= nextprime(p);
      P:= P*p;
      if isprime(P-1) then
        count:= count+1;
        A[count]:= n;
      fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Dec 25 2014
  • Mathematica
    a057704[n_] :=
    Flatten@Position[
    Rest[FoldList[Times, 1, Prime[Range[n]]]] - 1, Integer?PrimeQ]; a057704[500] (* _Michael De Vlieger, Dec 25 2014 *)
  • PARI
    lista(nn) = {s = 1; for(k=1, nn, s *= prime(k); if(ispseudoprime(s - 1), print1(k, ", ")); ); } \\ Altug Alkan, Dec 08 2015
    
  • PARI
    is(n) = ispseudoprime(prod(k=1, n, prime(k)) - 1); \\ Altug Alkan, Dec 08 2015

Formula

a(n) = A000720(A006794(n)).
a(n) = primepi(A006794(n)).

Extensions

Corrected by Holzer Werner, Nov 28 2002
a(19)-a(20) from Eric W. Weisstein, Dec 08 2015 (Mark Rodenkirch confirms based on saved log files that all p < 700,000 have been tested)
a(21) from Jeppe Stig Nielsen, Oct 19 2021
a(22)-a(24) from Jeppe Stig Nielsen, Dec 16 2024

A060256 Smallest multiple a(n) of n-th primorial q(n) such that a(n)*q(n)-1 and a(n)*q(n)+1 are a pair of twin primes.

Original entry on oeis.org

2, 1, 1, 2, 1, 6, 8, 11, 4, 16, 22, 4, 74, 24, 37, 28, 14, 11, 242, 11, 91, 20, 83, 91, 35, 80, 48, 47, 226, 2, 12, 203, 30, 38, 356, 54, 266, 108, 305, 227, 173, 1185, 738, 13, 382, 277, 455, 433, 173, 1303, 926, 1162, 164, 298, 69, 121, 702, 1670, 36, 570, 170, 204
Offset: 1

Views

Author

Labos Elemer, Mar 22 2001

Keywords

Examples

			30030*j-1 or 30030*j+1 are not both primes for j=1,2,3,4,5. But for j=6 {180179,180181} are twin primes. So a(6)=6.
		

Crossrefs

Programs

  • Mathematica
    smp[n_]:=Module[{k=1},While[!PrimeQ[k*n+1]||!PrimeQ[k*n-1],k++];k]; Table[ smp[n],{n,FoldList[Times,Prime[Range[70]]]}] (* Harvey P. Dale, Oct 27 2016 *)
  • PARI
    a(n)=p=vecprod(primes(n));for(k=1,+oo,ispseudoprime(k*p+1)&&ispseudoprime(k*p-1)&&return(k)) \\ Jeppe Stig Nielsen, Nov 09 2024

Extensions

Corrected and extended by Ray Chandler, Apr 03 2009

A060255 Smaller of twin primes {p, p+2} whose average p+1 = k*q is the least multiple of the n-th primorial number q such that k*q-1 and k*q+1 are twin primes.

Original entry on oeis.org

3, 5, 29, 419, 2309, 180179, 4084079, 106696589, 892371479, 103515091679, 4412330782859, 29682952539239, 22514519501013539, 313986271960080719, 22750921955774182169, 912496437361321252439, 26918644902158976946979, 1290172194953476680815969, 1901713815361424627522739779
Offset: 1

Views

Author

Labos Elemer, Mar 22 2001

Keywords

Comments

a(349) has 1001 digits. - Michael S. Branicky, Apr 19 2025

Examples

			a(13) = -1 + (2*3*5*7*...*41)*k(13) = 304250263527210*74 and {22514519501013539, 22514519501013542} are the corresponding primes; k(13)=74 is the smallest suitable multiplier. Twin primes obtained from primorial numbers with k=1 multiplier seem to be much rarer (see A057706).
For j=1,2,3,4,5,6, a(j)=A001359(1), A059960(1), A060229(1), A060230(1), A060231(1), A060232(1) respectively.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(q = prod(k=1, n, prime(k))); for(k=1, oo, if (isprime(q*k-1) && isprime(q*k+1), return(q*k-1)););} \\ Michel Marcus, Jul 10 2018
    
  • Python
    from itertools import count
    from sympy import primorial, isprime
    def a(n):
        p = primorial(n)
        return next(m-1 for m in count(p, p) if isprime(m-1) and isprime(m+1))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Apr 18 2025

Formula

a(n) = p = k(n)*q(n)-1, where q(n)=A002110(n) and k(n)=A060256(n) is the smallest integer whose multiplication by the n-th primorial yields p+1.

Extensions

a(2)=5 corrected by Ray Chandler, Apr 03 2009
a(18) and beyond from Michael S. Branicky, Apr 18 2025

A057822 Smaller of pair of twin primes whose average is lcm(1,...,m) for some m.

Original entry on oeis.org

5, 11, 59, 419, 232792559, 442720643463713815199
Offset: 1

Views

Author

Labos Elemer, Nov 08 2000

Keywords

Comments

Known values of m such that lcm(1,...,m) is a twin prime mean value are as follows: {3, 4, 5, 6, 7, 19, 20, 21, 22, 47, 48}.
No more such primes occurs below m < 2000.
No more such primes occurs below m < 30000. - Amiram Eldar, Aug 18 2024

Examples

			419 and 421 are twin primes, (419 + 421)/2 = 420 = lcm(1,2,3,4,5,6,7).
		

Crossrefs

Intersection of A057824 and {A049536(n)-2}.

Programs

  • Mathematica
    Select[FoldList[LCM, Select[Range[50], PrimePowerQ]] - 1, And @@ PrimeQ[# + {0, 2}] &] (* Amiram Eldar, Aug 18 2024 *)
  • PARI
    lista(nn=50) = {for (i=1, nn, if (isprimepower(i), if (isprime(p=lcm([2..i])-1) && isprime(p+2), print1(p, ", "));););} \\ Michel Marcus, Aug 25 2019

A333058 0, 1, or 2 primes at primorial(n) +- 1.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Frank Ellermann, Mar 06 2020

Keywords

Comments

a(n) = 0 marks a prime gap size of at least 2*prime(n+1)-1, e.g., primorial(8) +- prime(9) = {9699667,9699713} are primes, gap 2*23-1.
Mathworld reports that it is not known if there are an infinite number of prime Euclid numbers.
The tables in Ondrejka's collection contain no further primorial twin primes after {2309,2311} = primorial(13) +- 1 up to primorial(15877) +- 1 with 6845 digits.

Examples

			a(2) = a(3) = a(5) = 2: 2*3 +-1 = {5,7}, 6*5 +-1 = {29,31} and 210*11 +-1 = {2309,2311} are twin primes.
a(1) = a(4) = a(6) = 1: 1, 30*7 - 1 = 209 and 2310*13 + 1 = 30031 are not primes.
a(7) = 0: 510509 = 61 * 8369 and 510511 = 19 * 26869 are not primes.
		

References

  • H. Dubner, A new primorial prime, J. Rec. Math., 21 (No. 4, 1989), 276.

Crossrefs

Cf. A096831, A002110 (primorials, p#), A057706.
Cf. A006862 (Euclid, p#+1), A005234 (prime p#+1), A014545 (index prime p#+1).
Cf. A057588 (Kummer, p#-1), A006794 (prime p#-1), A057704 (index prime p#-1).
Cf. A010051, A088411 (where a(n) is positive), A088257.

Programs

  • Maple
    p:= proc(n) option remember; `if`(n<1, 1, ithprime(n)*p(n-1)) end:
    a:= n-> add(`if`(isprime(p(n)+i), 1, 0), i=[-1, 1]):
    seq(a(n), n=0..120);  # Alois P. Heinz, Mar 18 2020
  • Mathematica
    primorial[n_] := primorial[n] = Times @@ Prime[Range[n]];
    a[n_] := Boole@PrimeQ[primorial[n] - 1] + Boole@PrimeQ[primorial[n] + 1];
    a /@ Range[0, 105] (* Jean-François Alcover, Nov 30 2020 *)
  • Rexx
    S = ''                     ;  Q = 1
    do N = 1 to 27
       Q = Q * PRIME( N )
       T = ISPRIME( Q - 1 ) + ISPRIME( Q + 1 )
       S = S || ',' T
    end N
    S = substr( S, 3 )
    say S                      ;  return S

Formula

a(n) = [ isprime(primorial(n) - 1) ] + [ isprime(primorial(n) + 1) ].
a(n) = Sum_{i in {-1,1}} A010051(primorial(n) + i).
Showing 1-5 of 5 results.