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.

A056752 Distance from n! to the nearest prime.

This page as a plain text file.
%I A056752 #14 Jul 15 2017 11:05:10
%S A056752 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 A056752 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 A056752 179,53,59,127,61,149,107,109,137,139,71,71,101,67,127,283,73,83,103,97
%N A056752 Distance from n! to the nearest prime.
%H A056752 Hans Havermann, <a href="/A056752/b056752.txt">Table of n, a(n) for n = 1..2000</a>
%e A056752 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 A056752 with(numtheory): [seq(min(nextprime(i!)-i!,i!-prevprime(i!)),i=3..100)]; # a(1) and a(2) computed individually
%t A056752 Table[Function[k, Min[k - #, NextPrime@ # - k] &@If[n == 1, 0, Prime@ PrimePi@ k]][n!], {n, 16}] (* _Michael De Vlieger_, Jul 15 2017 *)
%Y A056752 Cf. A006990, A037151, A033932, A033933, A053714 (signed version with a different second term).
%K A056752 nonn
%O A056752 1,5
%A A056752 _Labos Elemer_, Jan 19 2001