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

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

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