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.

A140315 Numbers k such that k!/k#-1 and k!/k#+1 are a twin prime pair.

Original entry on oeis.org

4, 5, 8, 34, 280, 281
Offset: 1

Views

Author

Cino Hilliard, May 25 2008

Keywords

Comments

4,5 and 280,281 result in the same respective twin prime pairs. Using gmp, testing n < 4000, the last 3-prp found was the 8897 digit 3-prp, 3337!/3337#-1.

Examples

			8!/8#-1 = 191, 8!/8#-1 = 193. 191 and 193 form a twin prime pair.
		

Crossrefs

Programs

  • Mathematica
    Primorial[n_] := Product[Prime[i], {i, 1, PrimePi[n]}];
    Select[Range[
      1000], (p = (#! / Primorial[#]);
    PrimeQ[p + 1] && PrimeQ[p - 1]) &] (* Robert Price, Oct 11 2019 *)
  • PARI
    g(n) = for(x=1,n,y=x!/primorial(x)-1;z=nextprime(y+1); if(ispseudoprime(y)&&z-y==2,print1(x", ")))
    primorial(n) = { local(p1,x); if(n==0||n==1,return(1)); p1=1; forprime(x=2,n,p1*=x); return(p1) }

Formula

n# is the primorial function A034386(n).
A140293 INTERSECT A140294. - R. J. Mathar, Feb 27 2012

Extensions

Offset corrected by Amiram Eldar, Jul 18 2025