A075409 a(n) is the smallest m such that n!-m and n!+m are both primes.
0, 1, 5, 7, 19, 19, 31, 17, 11, 17, 83, 67, 353, 227, 163, 59, 61, 113, 353, 31, 1447, 571, 389, 191, 337, 883, 101, 1823, 659, 709, 163, 1361, 439, 307, 1093, 1733, 2491, 1063, 1091, 1999, 1439, 109, 2753, 607, 2617, 269, 103, 2663, 337, 14447, 2221, 5471, 2887
Offset: 2
Keywords
Examples
a(4)=5 because 4!=24 and 19 and 25 are primes with smallest distance 5 from 4!.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 2..100
Programs
-
Mathematica
smp[n_]:=Module[{m=1,nf=n!},While[!PrimeQ[nf+m]||!PrimeQ[nf-m],m=m+2];m]; Join[{0},Array[smp,60,3]] (* Harvey P. Dale, Apr 18 2014 *)
-
PARI
a(n) = {my (m=0); until (ok, ok = isprime(n!-m) && isprime(n!+m); if (!ok, m++);); return (m);} \\ Michel Marcus, Apr 19 2013
Extensions
More terms from David Wasserman, Jan 17 2005
Comments