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

A117847 Numbers k such that A060256(k)*prime(k)# - 1 is a Sophie Germain prime, where prime(k)# is the k-th primorial.

Original entry on oeis.org

1, 2, 3, 4, 8, 9, 10, 15, 24, 35, 37, 79, 340
Offset: 1

Views

Author

Pierre CAMI, May 01 2006

Keywords

Comments

This sequence gives the firsts of twin primes (A060256(n)*prime(n)# - 1, A060256(n)*prime(n)# + 1) which are also Sophie Germain primes.
a(14) > 367. - Amiram Eldar, Sep 11 2021

Examples

			16*(29#)-1 is the first of twin primes, 16 = A060256(10), 2*(16*(29#)-1)+1 is prime so 16*(29#)-1 is a Sophie Germain prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := Module[{p = Product[Prime[i], {i,1,n}], k=1}, While[!PrimeQ[k*p-1] || !PrimeQ[k*p+1], k++]; PrimeQ[2*k*p - 1]]; Select[Range[100], q] (* Amiram Eldar, Sep 11 2021 *)

Extensions

a(1)-a(6) inserted by Amiram Eldar, Sep 11 2021

A063983 Least k such that k*2^n +/- 1 are twin primes.

Original entry on oeis.org

4, 2, 1, 9, 12, 6, 3, 9, 57, 30, 15, 99, 165, 90, 45, 24, 12, 6, 3, 69, 132, 66, 33, 486, 243, 324, 162, 81, 90, 45, 345, 681, 585, 375, 267, 426, 213, 429, 288, 144, 72, 36, 18, 9, 147, 810, 405, 354, 177, 1854, 927, 1125, 1197, 666, 333, 519, 1032, 516, 258, 129, 72
Offset: 0

Views

Author

Robert G. Wilson v, Sep 06 2001

Keywords

Comments

Excluding the first three terms, all remaining terms have digital root 3, 6, or 9. - J. W. Helkenberg, Jul 24 2013

Examples

			a(3) = 9 because 9*2^3 = 72 and 71 and 73 are twin primes.
a(6) = 3 because 3*2^6 = 192 and {191, 193} are twin primes.
a(71) = 630 because 630*2^71 = 1487545442103938242314240 and {1487545442103938242314239, 1487545442103938242314241} are twin primes.
		

References

  • Richard Crandall and Carl Pomerance, 'Prime Numbers: A Computational Perspective,' Springer-Verlag, NY, 2001, page 12.

Crossrefs

Cf. A071256, A060210, A060256. For records see A125848, A125019.
Cf. A076806 (requires odd k).

Programs

  • Mathematica
    Table[Do[s=(2^j)*k; If[PrimeQ[s-1]&&PrimeQ[s+1],Print[{j,k}]], {k,1,2*j^2}],{j,0,100}]; (* outprint of a[j]=k *)
    Do[ k = 1; While[ ! PrimeQ[ k*2^n + 1 ] || ! PrimeQ[ k*2^n - 1 ], k++ ]; Print[ k ], {n, 0, 50} ]
    f[n_] := Block[{k = 1},While[Nand @@ PrimeQ[{-1, 1} + 2^n*k], k++ ];k];Table[f[n], {n, 0, 60}] (* Ray Chandler, Jan 09 2009 *)

Extensions

More terms from Labos Elemer, May 24 2002
Edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar

A071407 Least k such that k*prime(n) + 1 and k*prime(n) - 1 are twin primes.

Original entry on oeis.org

2, 2, 6, 6, 18, 24, 6, 12, 6, 12, 42, 54, 30, 24, 6, 120, 18, 258, 24, 18, 84, 132, 54, 48, 114, 42, 6, 6, 48, 24, 144, 30, 6, 12, 12, 78, 24, 36, 30, 54, 132, 18, 90, 36, 66, 18, 42, 30, 120, 30, 36, 42, 18, 18, 54, 84, 60, 12, 210, 12, 6, 60, 150, 102, 6, 210, 30, 24, 6
Offset: 1

Views

Author

Labos Elemer, May 24 2002

Keywords

Comments

Note that 6 divides a(n) for n > 2. - T. D. Noe, Jan 07 2013

Examples

			n=4: prime(4)=7, a(4)=6 because 6*prime(4)=42 and {41,43} are primes.
		

Crossrefs

Cf. A071558 (k at every integer).
Cf. A220141, A220142 (record values).

Programs

  • Haskell
    a071407 n = head [k | k <- [2,4..], let x = k * a000040 n,
                          a010051' (x - 1) == 1, a010051' (x + 1) == 1]
    -- Reinhard Zumkeller, Feb 14 2013
  • Mathematica
    Table[fl=1; Do[s=(Prime[j])*k; If[PrimeQ[s-1]&&PrimeQ[s+1]&&Equal[fl, 1], Print[{j, k}]; fl=0], {k, 1, 2*j^2}], {j, 0, 100}]

Formula

From Amiram Eldar, Aug 25 2025: (Start)
a(n) = A090530(n) / prime(n).
a(n) = 6 * A294731(n) for n >= 3. (End)

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

A071406 a(n) is the smallest multiplier of n! such that -1+a(n)*n! and 1+a(n)*n! are both primes.

Original entry on oeis.org

4, 2, 1, 3, 2, 17, 7, 6, 3, 14, 29, 30, 48, 27, 9, 24, 12, 97, 78, 47, 71, 80, 55, 13, 57, 20, 81, 259, 108, 163, 81, 118, 63, 215, 173, 513, 420, 561, 537, 1162, 158, 33, 122, 286, 459, 391, 305, 288, 114, 307, 15, 680, 355, 365, 338, 70, 23
Offset: 1

Views

Author

Labos Elemer, May 24 2002

Keywords

Examples

			n=7: a(7)=7, 7!=5040, 7.7!=35280 and {35279,35281} are primes.
		

Crossrefs

Programs

  • Mathematica
    Table[fl=1; Do[s=(j!)*k; If[PrimeQ[s-1]&&PrimeQ[s+1]&&Equal[fl, 1], Print[{j, k}]; fl=0], {k, 1, 2*j^2}], {j, 0, 100}]
    smnf[n_]:=Module[{k=1,f=n!},While[!PrimeQ[k*f+1]||!PrimeQ[k*f-1],k++]; k]; Array[smnf,60] (* Harvey P. Dale, May 24 2016 *)

A329916 Smallest k such that 6*k*A057130(n)-1 and 6*k*A057130(n)+1 are twin primes.

Original entry on oeis.org

1, 2, 3, 23, 11, 18, 77, 46, 84, 76, 22, 30, 3, 107, 26, 198, 136, 23, 236, 284, 167, 269, 381, 405, 379, 374, 620, 481, 606, 505, 163, 1414, 348, 639, 1696, 1429, 850, 2050, 740, 117, 362, 35, 3961, 72, 1307, 1816, 9410, 5705, 972, 368, 5083, 4387, 3296, 6039
Offset: 1

Views

Author

Pierre CAMI, Nov 24 2019

Keywords

Comments

A057130 gives the product of prime numbers (-1 mod 6) in the order of occurrence.

Examples

			A057130(1)=5, 6*1*5-1=29, and 29 and 31 are twin primes, so a(1)=1.
A057130(2)=55, 6*2*55-1=659, and 659 and 661 are twin primes, so a(2)=2.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(pp = 1); forprime (p = 1, nn, if (Mod(p, 6) == -1, pp *= p; my(k=1); while (!isprime(6*k*pp-1) || !isprime(6*k*pp+1), k++); print1(k, ", ");););} \\ Michel Marcus, Nov 25 2019

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

A096937 Least k such that k*P(n)#/2 - 2 and k*P(n)#/2 + 2 are both primes, where P(i)= i-th prime, P(i)# = i-th primorial.

Original entry on oeis.org

5, 3, 1, 1, 3, 1, 3, 41, 27, 3, 1, 171, 97, 19, 35, 13, 217, 57, 79, 133, 41, 219, 85, 43, 477, 205, 35, 455, 635, 275, 2081, 33, 513, 671, 427, 177, 997, 2671, 601, 123, 525, 1139, 411, 479, 363, 1311, 4685, 109, 159, 3367, 2761, 257, 161, 137, 49, 393, 3553, 1807
Offset: 1

Views

Author

Pierre CAMI, Aug 18 2004

Keywords

Examples

			1*2*3*5*7/2 - 2 = 103, 1*2*3*5*7/2 + 2 = 107, 103 and 107 are both primes, so for n=4, k=1.
		

Crossrefs

Cf. A060256.

Programs

  • Mathematica
    Primorial[n_] := Product[Prime[i], {i, 1, n}]; f[n_] := Block[{p = Primorial[n]/2, k = 1}, While[ !PrimeQ[k*p - 2] || !PrimeQ[k*p + 2], k++ ]; k]; Table[ f[n], {n, 50}] (* Robert G. Wilson v, Aug 19 2004 *)

Extensions

More terms from Robert G. Wilson v, Aug 19 2004

A100804 Smallest prime P such that n*P# -1 and n*P# +1 are twin primes, where P#=primorial P, or 0 if no such prime exists.

Original entry on oeis.org

3, 2, 2, 11, 3, 2, 3, 5, 2, 3, 7, 3, 7, 5, 2, 7, 3, 3, 5, 5, 2, 5, 3, 11, 3
Offset: 1

Views

Author

Pierre CAMI, Jan 04 2005

Keywords

Comments

No solutions found yet for n = {26, 39, 46, 59, 63, 68, 76, 81, 82, 84, 89} through prime(1700) = 14519. - Ray Chandler, Jan 23 2005
The sequence continues: a(26)=?, 5, 7, 7, 2, 19, 3, 3, 5, 5, 2, 19, 3, a(39)=?, 3, 5, 7, 5, 5, 3, a(46)=?, 3, 11, 17, 7, 2, 3, 43, 2, 7, 37, 7, 3, a(59)=?, 151, 31, 13, a(63)=?. - Robert G. Wilson v, Jan 12 2005

Examples

			For n=4:
4*2=8 8-1=7 prime but 8+1=9=3*3.
4*2*3=24 24-1=23 prime but 24+1=25=5*5.
4*2*3*5=120 120-1=119=7*17.
4*2*3*5*7=840 840-1=839 prime but 840+1=841=29*29.
4*2*3*5*7*11=9240 9240-1=9239 prime 9240+1=9241 prime so for n=4 P=11.
		

Crossrefs

Cf. A060256.

Programs

  • Mathematica
    Primorial[n_] := Product[Prime[i], {i, n}]; f[n_] := Block[{k = 1}, While[p = n*Primorial[k]; !PrimeQ[p - 1]\ || ! PrimeQ[p + 1], k++ ]; Prime[k]]; Table[ f[n], {n, 25}] (* Robert G. Wilson v, Jan 12 2005 *)
Showing 1-9 of 9 results.