OFFSET
1,5
LINKS
Hans Havermann, Table of n, a(n) for n = 1..2000
EXAMPLE
For both 1! and 2! the nearest prime neighbor is 2, with distances of 1 and 0, respectively. The nearest primes around 8! are 40289 and 40343 with distances of 31 and 23, so a(8)=23.
MAPLE
with(numtheory): [seq(min(nextprime(i!)-i!, i!-prevprime(i!)), i=3..100)]; # a(1) and a(2) computed individually
MATHEMATICA
Table[Function[k, Min[k - #, NextPrime@ # - k] &@If[n == 1, 0, Prime@ PrimePi@ k]][n!], {n, 16}] (* Michael De Vlieger, Jul 15 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jan 19 2001
STATUS
approved