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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A245714 Least number k > 0 such that n + k! is prime, or 0 if no such k exists. 4

%I

%S 1,1,2,1,2,1,3,0,2,1,2,1,3,0,2,1,2,1,4,0,2,1,3,0,3,0,2,1,2,1,3,0,0,0,

%T 2,1,3,0,2,1,2,1,4,0,2,1,3,0,4,0,2,1,3,0,3,0,2,1,2,1,3,0,0,0,2,1,3,0,

%U 2,1,2,1,3,0,0,0,2,1,4,0,2,1,3,0,4,0,2,1,4,0,3,0,0,0,2,1,3,0,2,1,2,1,3,0,2,1,2,1,5,0,2,1,4,0,4,0,0,0,5

%N Least number k > 0 such that n + k! is prime, or 0 if no such k exists.

%C a(n) <= n for all n. Thus a(n) = 0 is definite.

%H Vaclav Kotesovec, <a href="/A245714/b245714.txt">Table of n, a(n) for n = 1..5000</a>

%e 7 + 1! = 8 is not prime.

%e 7 + 2! = 9 is not prime.

%e 7 + 3! = 13 is prime. Thus a(7) = 3.

%o (PARI)

%o a(n)=for(k=1,n,if(ispseudoprime(n+k!),return(k)))

%o vector(150,n,a(n))

%Y Cf. A245723.

%K nonn

%O 1,3

%A _Derek Orr_, Jul 30 2014

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.

Last modified January 24 09:11 EST 2022. Contains 350534 sequences. (Running on oeis4.)