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

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

A071558 Smallest k such that n*k + 1 and n*k - 1 are twin primes.

Original entry on oeis.org

4, 2, 2, 1, 6, 1, 6, 9, 2, 3, 18, 1, 24, 3, 2, 12, 6, 1, 12, 3, 2, 9, 6, 3, 6, 12, 4, 15, 12, 1, 42, 6, 6, 3, 12, 2, 54, 6, 8, 6, 30, 1, 24, 15, 4, 3, 6, 4, 18, 3, 2, 6, 120, 2, 12, 48, 4, 6, 18, 1, 258, 21, 14, 3, 30, 3, 24, 15, 2, 6, 18, 1, 84, 27, 2, 3, 6, 4, 132, 3, 10, 15, 54, 5, 12, 12
Offset: 1

Views

Author

Benoit Cloitre, May 30 2002

Keywords

Comments

Conjecture: a(n) < sqrt(n)*log(n) for all n > 17261. This has been verified for n up to 3*10^7. It implies the inequality a(n) < n for each n > 127. - Zhi-Wei Sun, Jan 07 2013
A200996(n) <= a(n). - Reinhard Zumkeller, Feb 14 2013

Crossrefs

Cf. A071407 (k at prime n).
Cf. A220143, A220144 (record values).

Programs

  • Haskell
    a071558 n = head [k | k <- [1..], let x = k * n,
                          a010051' (x - 1) == 1, a010051' (x + 1) == 1]
    -- Reinhard Zumkeller, Feb 14 2013
  • Mathematica
    Table[k=1; While[!And@@PrimeQ[n*k+{1,-1}],k++]; k,{n,86}] (* Jayanta Basu, May 26 2013 *)
  • PARI
    a(n) = my(s=1); while(isprime(s*n+1)*isprime(n*s-1)==0, s++); s;
    

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)

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 *)

A090531 Least multiple of n! sandwiched between twin primes, or 0 if no such number exists.

Original entry on oeis.org

4, 4, 6, 72, 240, 12240, 35280, 241920, 1088640, 50803200, 1157587200, 14370048000, 298896998400, 2353813862400, 11769069312000, 502146957312000, 4268249137152000, 621030249455616000, 9488317831888896000
Offset: 1

Views

Author

Amarnath Murthy, Dec 07 2003

Keywords

Comments

Conjecture: No term is zero.
This conjecture is implied by Dickson's conjecture. - Robert Israel, Feb 13 2018

Crossrefs

Programs

  • Maple
    f := proc (n) local k, t; t := factorial(n); for k from t by t do if isprime(k-1) and isprime(k+1) then return k end if end do end proc;
    map(f, [`$`(1 .. 20)]); # Robert Israel, Feb 13 2018
  • Mathematica
    lmn[n_]:=Module[{k=n!,m=1},While[AnyTrue[k*m+{1,-1},CompositeQ],m++];k*m]; Join[{4,4},Array[lmn,20,3]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 27 2020 *)

Formula

a(n) = A071256(A000142(n)). - Robert Israel, Feb 13 2018

Extensions

More terms from Ryan Propper, Jun 16 2005

A387287 Primes in the order of their first appearance among the factors of the averages of twin prime pairs.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 11, 19, 47, 13, 29, 103, 107, 137, 43, 59, 41, 71, 31, 67, 139, 283, 149, 313, 37, 347, 373, 397, 443, 113, 467, 271, 181, 281, 577, 593, 199, 157, 653, 131, 101, 89, 241, 83, 251, 379, 773, 787, 167, 109, 907, 163, 73, 1033, 53, 223, 1117
Offset: 1

Views

Author

Tamas Sandor Nagy, Aug 25 2025

Keywords

Comments

Will every prime appear, so that this sequence is a permutation of the primes?
The answer is yes if A071256(n) exists for every n. - Robert Israel, Aug 25 2025

Examples

			a(1) = 2 because 2 appeared first as a prime factor of the average of a twin prime pair, namely of 4 = 2*2 = 2^2, the average of 3 and 5, the first twin prime pair.
a(2) = 3 because 3 appeared next as a prime factor of the average of a twin prime pair, here 6 = 2*3, of the twin primes 5 and 7.
a(3) = 5 because 5 appeared next as a prime factor of the average of a twin prime pair, this time of 30 = 2*3*5, between 29 and 30. The averages 12 and 18 are skipped as their factors, 2 and 3, already appeared.
a(5) = 17 following a(4) = 7, skipping the primes 11 and 13 in the order of appearances.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime, {seq(i,i=3..10^4,2)}):
    TPA:= map(`+`, P intersect map(`-`,P,2),1):
    TPA:= sort(convert(TPA,list)):
    R:= NULL: S:= {}:
    for t in TPA do
      V:= numtheory:-factorset(t) minus S;
      if nops(V) > 1 then printf("t = %d: %a\n",t,V) fi;
      R:= R, op(sort(convert(V,list)));
      S:= S union V;
    od:
    R; # Robert Israel, Aug 25 2025
  • Mathematica
    With[{m = Select[Prime[Range[1000]], PrimeQ[# + 2] &] + 1}, DeleteDuplicates[Flatten[FactorInteger[#][[;; , 1]] & /@ m]]] (* Amiram Eldar, Aug 25 2025 *)
Showing 1-6 of 6 results.