login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Distance from n! to the nearest prime.
4

%I #14 Jul 15 2017 11:05:10

%S 1,0,1,1,7,1,1,23,13,11,1,1,23,1,43,23,31,37,89,29,31,31,89,73,41,37,

%T 1,67,31,1,61,1,1,97,61,127,1,1,73,53,1,79,71,47,53,89,79,53,59,61,

%U 179,53,59,127,61,149,107,109,137,139,71,71,101,67,127,283,73,83,103,97

%N Distance from n! to the nearest prime.

%H Hans Havermann, <a href="/A056752/b056752.txt">Table of n, a(n) for n = 1..2000</a>

%e 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.

%p with(numtheory): [seq(min(nextprime(i!)-i!,i!-prevprime(i!)),i=3..100)]; # a(1) and a(2) computed individually

%t Table[Function[k, Min[k - #, NextPrime@ # - k] &@If[n == 1, 0, Prime@ PrimePi@ k]][n!], {n, 16}] (* _Michael De Vlieger_, Jul 15 2017 *)

%Y Cf. A006990, A037151, A033932, A033933, A053714 (signed version with a different second term).

%K nonn

%O 1,5

%A _Labos Elemer_, Jan 19 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 19:13 EDT 2024. Contains 376138 sequences. (Running on oeis4.)