login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056752 Distance from n! to the nearest prime. 4
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, 1, 67, 31, 1, 61, 1, 1, 97, 61, 127, 1, 1, 73, 53, 1, 79, 71, 47, 53, 89, 79, 53, 59, 61, 179, 53, 59, 127, 61, 149, 107, 109, 137, 139, 71, 71, 101, 67, 127, 283, 73, 83, 103, 97 (list; graph; refs; listen; history; text; internal format)
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

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

Sequence in context: A157272 A176200 A046739 * A053714 A168290 A218695

Adjacent sequences:  A056749 A056750 A056751 * A056753 A056754 A056755

KEYWORD

nonn

AUTHOR

Labos Elemer, Jan 19 2001

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 30 19:02 EST 2021. Contains 349424 sequences. (Running on oeis4.)