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

A088411 A088257 indexed by A002110.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 11, 13, 24, 66, 68, 75, 167, 171, 172, 287, 310, 352, 384, 457, 564, 590, 616, 620, 643, 849, 1391, 1552, 1613, 1849, 2122, 2647, 2673, 4413, 13494, 31260, 33237, 67132, 85586, 234725
Offset: 1

Views

Author

Ray Chandler, Sep 29 2003

Keywords

Comments

Union of A057704 and A014545. - Jeppe Stig Nielsen, Aug 01 2019

Examples

			3 is in the sequence because primorial p_3# = 2 * 3 * 5 = 30 has two prime neighbors 29 and 31.
4 is in the sequence because primorial p_4# = 2 * 3 * 5 * 7 = 210 has one prime neighbor 211; 209 = 11 * 19.
7 is not in the sequence because the product of the smallest 7 primes has two composite neighbors.
		

Crossrefs

Programs

  • Maple
    A:= NULL:
    P:= 1: p:= 1;
    for n from 1 to 700 do
      p:= nextprime(p);
      P:= P*p;
      if isprime(P+1) or isprime(P-1) then A:= A, n fi
    od:
    A; # Robert Israel, Aug 03 2016
  • Mathematica
    Select[Range[0, 600], Total@ Boole@ PrimeQ@ {# - 1, # + 1} > 0 &@ Apply[Times, Prime@ Range@ #] &] (* Michael De Vlieger, Aug 03 2016 *)
  • PARI
    is(k)=pr=prod(j=1,k,prime(j));ispseudoprime(pr-1)||ispseudoprime(pr+1) \\ Jeppe Stig Nielsen, Aug 01 2019

Formula

a(n)=k such that A088257(n)=A002110(k).

Extensions

a(22)-a(27) from Michael De Vlieger, Aug 03 2016
a(28)-a(40) from Jeppe Stig Nielsen, Aug 01 2019
a(41) from Jeppe Stig Nielsen, Oct 19 2021

A088256 Primorial numbers k such that both k-1 and k+1 are prime.

Original entry on oeis.org

6, 30, 2310
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2003

Keywords

Comments

Conjecture: sequence is finite.
No more terms in the first 300 primorials. - David Wasserman, Jul 25 2005
Search extended to first 700 primorials by Michael De Vlieger, Aug 31 2016
Intersection of A014574 and A002110. - Michel Marcus, Dec 03 2016
Search extended to first 3000 primorials. - Josey Stevens, Aug 10 2021
The first more than 230000 primorial numbers k have been checked for whether k-1 or k+1 or both are primes. See links. If another term k exists, it is over about 10^1400000. - Jeppe Stig Nielsen, Oct 19 2021

Examples

			210 = primorial(4) is not a member as 209 is composite.
		

Crossrefs

Programs

  • Maple
    f:= proc(n)
      local P;
      P:= mul(seq(ithprime(i),i=1..n));
      if isprime(P+1) and isprime(P-1) then P else NULL fi
    end proc:
    map(f, [$1..300]); # Robert Israel, Aug 31 2016
  • Mathematica
    Select[Times @@ # & /@ Prime@ Range@ Range@ 700, Times @@ Boole@ PrimeQ@ {# - 1, # + 1} == 1 &] (* Michael De Vlieger, Aug 31 2016 *)
    Select[FoldList[Times,Prime[Range[20]]],AllTrue[#+{1,-1},PrimeQ]&] (* Harvey P. Dale, Mar 31 2023 *)
  • PARI
    lista(nn) = for (n=1, nn, pr = prod(i=1, n, prime(i)); if (isprime(pr-1) && isprime(pr+1), print1(pr, ", "))); \\ Michel Marcus, Aug 31 2016

Extensions

Corrected by Ray Chandler, Sep 28 2003

A088258 Factorials F which have at least one prime neighbor, i.e., F+1 or F-1 or both are primes.

Original entry on oeis.org

1, 2, 6, 24, 720, 5040, 39916800, 479001600, 87178291200, 10888869450418352160768000000, 265252859812191058636308480000000, 263130836933693530167218012160000000
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2003

Keywords

Comments

Conjecture: sequence is infinite. But there are finitely many members which are sandwiched between twin primes.

Examples

			2 is in the sequence because 2 + 1 is prime.
6 is in the sequence because both 6 - 1 and 6 + 1 are prime.
24 is in the sequence because 24 - 1 is prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t+1) or isprime(t-1), [seq(n!,n=1..100)]); # Robert Israel, Aug 25 2016
  • Mathematica
    Select[Range[32]!, Or @@ PrimeQ@ {# - 1, # + 1} &] (* Michael De Vlieger, Aug 25 2016 *)

Formula

a(n) = A088412(n)! = A000142(A088412(n)). - Robert Israel, Aug 25 2016

Extensions

More terms from Ray Chandler, Sep 28 2003

A088259 Perfect powers which have at least one prime neighbor.

Original entry on oeis.org

1, 4, 8, 16, 32, 36, 100, 128, 196, 256, 400, 576, 676, 1296, 1600, 2916, 3136, 4356, 5476, 7056, 8100, 8192, 8836, 12100, 13456, 14400, 15376, 15876, 16900, 17956, 21316, 22500, 24336, 25600, 28900, 30976, 32400, 33856, 41616, 42436, 44100
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2003

Keywords

Comments

If K is a term and K-1 is the neighboring prime then it must be a Mersenne prime.
Conjecture: sequence is infinite.

Crossrefs

Intersection of A001597 and A045718.

Programs

  • Mathematica
    Join[{1},Select[Range[45000],GCD@@FactorInteger[#][[All,2]]>1 && AnyTrue[ #+{1,-1},PrimeQ]&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 05 2020 *)

Extensions

Corrected and extended by Ray Chandler, Sep 28 2003
Offset changed by Andrew Howroyd, Sep 22 2024

A382785 a(n) is the least multiple of the n-th primorial such that both a(n)-1 and a(n)+1 are prime and the prime factors of a(n) do not exceed prime(n).

Original entry on oeis.org

4, 6, 30, 420, 2310, 180180, 4084080, 106696590, 892371480, 103515091680, 4412330782860, 29682952539240, 22514519501013540, 313986271960080720, 22750921955774182170, 912496437361321252440, 26918644902158976946980, 1290172194953476680815970, 1901713815361424627522739780
Offset: 1

Views

Author

Rory Pulvino, Apr 04 2025

Keywords

Comments

a(n) is the smallest multiple k of the n-th primorial, prime(n)#, such that both k-1 and k+1 are prime and the prime factors of m = k/prime(n)# do not exceed prime(n).
From Michael S. Branicky, Apr 19 2025: (Start)
a(n) first differs from A060255(n) + 1 at n = 29.
a(349) has 1001 digits. (End)

Examples

			For a(2), (2*3)*1 = 6 and the first twin primes are 5, 7.
For a(3), (2*3*5)*1 = 30 and the first twin primes are 29, 31.
For a(4), (2*3*5*7)*2 = 420, the first twin primes are 419, 421 and 2 <= prime(4).
For a(5), (2*3*5*7*11)*1 = 2310 and the first twin primes are 3209, 3211.
For a(6), (2*3*5*7*11*13)*2*3 = 180180. the first twin primes are 180179, 180181 and 2, 3 <= prime(6).
		

Crossrefs

Supersequence of A088256.

Programs

  • Mathematica
    a[n_] := Module[{P,k},P=Product[Prime[i],{i, 1, n}];k = 1; While[!(PrimeQ[k*P-1] && PrimeQ[k*P+1]), k++];k*P] (* James C. McMahon, May 09 2025 *)
  • PARI
    isok(k, p) = if (k>1, vecmax(factor(k)[,1])<=p, 1);
    a(n) = my(P=vecprod(primes(n)), k=1, p=prime(n)); while(!(isok(k, p) && ispseudoprime(k*P-1) && ispseudoprime(k*P+1)), k++); k*P; \\ Michel Marcus, Apr 27 2025
  • Python
    from itertools import count
    from sympy import factorint, isprime, prime, primorial
    def a(n):
        pn, prn = prime(n), primorial(n)
        return next(k for m in count(1) if max(factorint(m), default=1)<=pn and isprime((k:=m*prn)-1) and isprime(k+1))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Apr 18 2025
    

Extensions

Data corrected by Michael S. Branicky, Apr 18 2025

A384545 Smallest prime(n)-smooth multiplier, m, such that both m*(prime(n)#)-1 and m*(prime(n)#)+1 are prime.

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, 1199, 2, 12, 203, 30, 38, 356, 54, 266, 108, 305, 255, 173, 1185, 738, 13, 382, 730, 455, 2156, 173, 1633, 2021, 1162, 164, 298, 69, 121, 702, 1670, 36, 570, 170, 204, 285, 908, 247
Offset: 1

Views

Author

Ken Clements, Jun 02 2025

Keywords

Comments

The multipliers produce the closest (by multiplication) twin prime average, at or above, the n-th primorial, without introducing new prime factors. That these numbers are so small in relation to the size of the primorials indicates a relationship to the twin prime number density in the neighborhood of the primorials. The "1" entries indicate that the 2nd, 3rd and 5th primorial numbers sit between twin primes.
The numbers a(n)*A002110(n) are in A384530, which is a subsequence of A014574.

Examples

			For n = 1, a(1) = 2 because the first primorial = 2 and 2*2 = 4, the average of primes 3 and 5.
For n = 2, a(2) = 1 because the second primorial = 6, the average of primes 5 and 7.
For n = 3, a(3) = 1 because the third primorial = 30, the average of primes 29 and 31.
For n = 8, a(8) = 11 because the eighth primorial = 9699690 and 11 times that is 106696590 which is the average of primes 106696589 and 106696591, and 11 has no prime factor greater than the greatest prime factor of the eighth primorial (which is 19), and no positive integer multiple less than 11 will result in a product that is bracketed by twin prime numbers.
		

Crossrefs

Programs

  • Python
    from sympy import primorial, prime, factorint
    from gmpy2 import is_prime
    def is_pr_smooth(n, r):
        return max(factorint(n).keys()) <= prime(r) if n > 1 else True
    def first_twin_bracketed_multiplier(r):
        prim_r = primorial(r)
        m = 1
        while True:
            if is_pr_smooth(m, r):
                n = prim_r * m
                if is_prime(n-1) and is_prime(n+1):
                    return m
            m += 1
    def aupto(terms):
        return [first_twin_bracketed_multiplier(r) for r in range(1, terms+1)]
    print(aupto(50))

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