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.

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;
    

A294731 Smallest average of a twin prime pair divisible by the n-th prime, i.e. A090530(n), divided by 6*prime(n).

Original entry on oeis.org

1, 1, 3, 4, 1, 2, 1, 2, 7, 9, 5, 4, 1, 20, 3, 43, 4, 3, 14, 22, 9, 8, 19, 7, 1, 1, 8, 4, 24, 5, 1, 2, 2, 13, 4, 6, 5, 9, 22, 3, 15, 6, 11, 3, 7, 5, 20, 5, 6, 7, 3, 3, 9, 14, 10, 2, 35, 2, 1, 10, 25, 17, 1, 35, 5, 4, 1, 18, 15, 12, 25, 1, 2, 5
Offset: 3

Views

Author

Hugo Pfoertner, Nov 09 2017

Keywords

Comments

The sequence starts at n=3, because A090530(1)=4 is not divisible by 6*2 and A090530(2)=6 is not divisible by 6*3.
The positions of ones in the sequence are given by A060212, i.e. a(A000720(A060212(n)))=1 for all n>=3.

Examples

			a(5)=3 because 198 is the smallest average of a twin prime pair {197,199} that is divisible by the 5th prime 11: 3 = 198 / (6*11).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = Prime[n], k = 1}, While[! PrimeQ[6*k*p - 1] || ! PrimeQ[6*k*p + 1], k++]; k]; Array[a, 100, 3] (* Amiram Eldar, Aug 25 2025 *)

Formula

a(n) = A090530(n) / ( 6 * prime(n) ) for n >= 3.
a(n) = A071407(n) / 6. - Amiram Eldar, Aug 25 2025

A090530 Least multiple k of prime(n) such that (k-1,k+1) forms a twin prime pair, or 0 if no such number exists.

Original entry on oeis.org

4, 6, 30, 42, 198, 312, 102, 228, 138, 348, 1302, 1998, 1230, 1032, 282, 6360, 1062, 15738, 1608, 1278, 6132, 10428, 4482, 4272, 11058, 4242, 618, 642, 5232, 2712, 18288, 3930, 822, 1668, 1788, 11778, 3768, 5868, 5010, 9342, 23628, 3258, 17190
Offset: 1

Views

Author

Amarnath Murthy, Dec 07 2003

Keywords

Comments

a(n) is a multiple of 6*prime(n) for n>2. Conjecture: No term is zero.

Examples

			a(5) = 198 = 11*18, (197,199) forms a twin prime pair.
		

Crossrefs

Cf. A014574, A071407, A090531, A294731 [a(n)/(6*prime(n))].

Programs

  • Mathematica
    For[n = 1, n < 40, n++, a := Prime[n]; k := 2; While[Not[PrimeQ[k*a + 1] && PrimeQ[k*a - 1]], k += 2]; Print[k*a]] (* Stefan Steinerberger, Feb 17 2006 *)
  • PARI
    a(n) = { my(k = 2, p = prime(n)); while (! (isprime(k*p-1) && isprime(k*p+1)), k++); k*p;} \\ Michel Marcus, Nov 12 2017

Formula

a(n) = prime(n) * A071407(n). - Amiram Eldar, Aug 25 2025

Extensions

More terms from David Wasserman, Dec 21 2005
More terms from Stefan Steinerberger, Feb 17 2006

A220141 Prime numbers p that yield a new record for the least number k such that p*k + 1 and p*k - 1 are twin primes.

Original entry on oeis.org

2, 5, 11, 13, 31, 37, 53, 61, 433, 3023, 3989, 4079, 9967, 10789, 76943, 81439, 121763, 233969, 491333, 495931, 795659, 1653901, 2623969, 3516277, 6274823, 10536689, 11313839, 12023191, 16268899, 22829309, 38968109, 41230733, 45057577, 76384717, 98566373, 552843883
Offset: 1

Views

Author

T. D. Noe, Jan 08 2013

Keywords

Comments

These are the primes at which A071407 reaches a new record. The corresponding values of k are in A220142.

Crossrefs

Programs

  • Mathematica
    t = {{2, 2}}; Do[k = 1; While[! (PrimeQ[k*n - 1] && PrimeQ[k*n + 1]), k++]; If[k > t[[-1, 2]], AppendTo[t, {n, k}]], {n, Prime[Range[2, 1000]]}]; Transpose[t][[1]]

Extensions

More terms from Amiram Eldar, Dec 30 2019

A220142 The values of k in A220141.

Original entry on oeis.org

2, 6, 18, 24, 42, 54, 120, 258, 396, 480, 612, 840, 1074, 1800, 2130, 2172, 2256, 2550, 2694, 3282, 3492, 3690, 3810, 4110, 4626, 4788, 4860, 4992, 5148, 5280, 5958, 5994, 6804, 7920, 9654, 9660, 11082, 16134
Offset: 1

Views

Author

T. D. Noe, Jan 08 2013

Keywords

Crossrefs

Programs

  • Mathematica
    t = {{2, 2}}; Do[k = 1; While[! (PrimeQ[k*n - 1] && PrimeQ[k*n + 1]), k++]; If[k > t[[-1, 2]], AppendTo[t, {n, k}]], {n, Prime[Range[2, 1000]]}]; Transpose[t][[2]]

Extensions

More terms from Amiram Eldar, Dec 30 2019

A294078 a(n) is the smallest even number k such that k*prime(n) - 1 or k*prime(n) + 1 is prime.

Original entry on oeis.org

2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 4, 6, 2, 6, 6, 4, 4, 4, 2, 2, 2, 2, 6, 6, 6, 6, 2, 4, 2, 4, 2, 8, 6, 2, 4, 10, 2, 2, 6, 2, 4, 4, 2, 2, 8, 4, 2, 2, 2, 6, 2, 6, 4, 6, 2, 4, 2, 6, 2, 2, 6, 6, 6, 2, 2, 6, 8, 10, 2, 2, 4, 2, 4, 6, 6, 8, 4
Offset: 1

Views

Author

Dimitris Valianatos, Feb 07 2018

Keywords

Comments

For n <= 10^9 the largest term is 186.
First occurrence of 2k, k=1,2,3,...: 1, 6, 15, 35, 39, 117, 1134, 199, 152, 362, ..., . - Robert G. Wilson v, Feb 08 2018

Examples

			For n = 6, prime(6) = 13. The smallest even number k such that k * 13 + 1 is a prime number is k = 4, because 4 * 13 + 1 = 53 (not k = 2). So 4 is the sixth term.
		

Crossrefs

Cf. A000040, A071407 (with "and" rather than "or").

Programs

  • Mathematica
    f[n_] := Block[{k = 2, p = Prime@ n}, While[ !PrimeQ[k*p -1] && !PrimeQ[k*p +1], k += 2]; k]; Array[f, 100] (* Robert G. Wilson v, Feb 08 2018 *)
  • PARI
    {
      forprime(p=2,100,
        k=2;
        while(!isprime(k*p-1)&&!isprime(k*p+1),k+=2);
        print1(k", ");
      )
    }

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