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.

A053708 Nearest prime to n! (but not equal to n!).

This page as a plain text file.
%I A053708 #18 Mar 10 2025 05:06:33
%S A053708 2,3,5,23,113,719,5039,40343,362867,3628789,39916801,479001599,
%T A053708 6227020777,87178291199,1307674368043,20922789888023,355687428096031,
%U A053708 6402373705728037,121645100408832089,2432902008176640029,51090942171709439969,1124000727777607680031,25852016738884976639911
%N A053708 Nearest prime to n! (but not equal to n!).
%C A053708 If n! is the average of its closest prime neighbors then the smaller prime is to be chosen (as in A051701).
%H A053708 Amiram Eldar, <a href="/A053708/b053708.txt">Table of n, a(n) for n = 1..449</a>
%e A053708 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.
%t A053708 f[n_]:=Module[{nf=n!,s,l},s=NextPrime[nf,-1];l=NextPrime[nf];If[nf-s>l-nf,l,s]]
%t A053708 Table[f[i],{i,25}] (* _Harvey P. Dale_, Dec 08 2010 *)
%Y A053708 Cf. A000142, A033932, A037151, A033933, A006990.
%K A053708 nonn
%O A053708 1,1
%A A053708 _Labos Elemer_, Feb 10 2000
%E A053708 Corrected by _Rick L. Shepherd_, Jan 11 2006
%E A053708 a(21)-a(23) from _Amiram Eldar_, Mar 10 2025