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.

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)