A139186 a(n) is the smallest k such that k!/n +- 1 is a twin prime pair.
3, 4, 6, 4, 11, 4
Offset: 1
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).
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
Comments