OFFSET
1,1
COMMENTS
If n! is the average of its closest prime neighbors then the smaller prime is to be chosen (as in A051701).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..449
EXAMPLE
For 8! = 40320 the closest upper and lower primes are 40289 and 40343 with d = 31 and d = 23, so 40343 is closer to 8! than the lower neighbor.
MATHEMATICA
f[n_]:=Module[{nf=n!, s, l}, s=NextPrime[nf, -1]; l=NextPrime[nf]; If[nf-s>l-nf, l, s]]
Table[f[i], {i, 25}] (* Harvey P. Dale, Dec 08 2010 *)
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, Feb 10 2000
EXTENSIONS
Corrected by Rick L. Shepherd, Jan 11 2006
a(21)-a(23) from Amiram Eldar, Mar 10 2025
STATUS
approved