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.

A139186 a(n) is the smallest k such that k!/n +- 1 is a twin prime pair.

Original entry on oeis.org

3, 4, 6, 4, 11, 4
Offset: 1

Views

Author

Artur Jasinski, Apr 11 2008

Keywords

Comments

Smallest factorial indices k such that (k!/n-1, k!/n+1) = (A001359(j), A006512(j)) for some twin prime index j.
If it exists, a(7) > 1000. A continuation of the sequence, with unknown terms indicated by 0, is a(8)..a(50): 10, 0, 5, 0, 6, 0, 0, 8, 0, 0, 0, 21, 5, 7, 0, 0, 6, 22, 0, 10, 7, 0, 5, 0, 0, 0, 0, 8, 10, 0, 0, 16, 6, 0, 0, 0, 13, 0, 43, 0, 9, 0, 26. The unknown terms have been checked through k <= 1000. - Hugo Pfoertner, Mar 29 2020

Examples

			For n=6, solutions to k!/n - 1 = A001359(j) are given by k = 4, 11, 13, 17, ...
The smallest k out of these, k=4, is a(6).
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[k = 1; While[ ! (PrimeQ[(k! - n)/n] && PrimeQ[(k! + n)/n]), k++ ]; AppendTo[a, k]; Print[a], {n, 1, 6}]; a
  • PARI
    a(n) = {my(k=1); while (! ((denominator(m=k!/n)==1) && isprime(m-1) && isprime(m+1)), k++); k;} \\ Michel Marcus, Mar 29 2020

Formula

A000142(a(n))/n - 1 = A139187(n).
A000142(a(n))/n + 1 = A139188(n).