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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A241425 Largest number k > 0 such that n + k! and n - k! are both prime, or 0 if no such k exists. 2
 0, 0, 0, 1, 2, 1, 0, 0, 2, 0, 3, 1, 3, 0, 2, 0, 3, 1, 0, 0, 2, 0, 3, 0, 3, 0, 0, 0, 4, 1, 0, 0, 0, 0, 4, 0, 4, 0, 2, 0, 0, 1, 4, 0, 2, 0, 4, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 3, 0, 2, 0, 0, 1, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,5 COMMENTS If k > n, n - k! is surely negative and, therefore, not prime. a(n) < A020639(n). - Robert Israel, Aug 10 2014 LINKS Robert Israel, Table of n, a(n) for n = 1..10000 MAPLE a:= proc(n) local k; for k from min(numtheory:-factorset(n))-1 to 1 by -1 do   if n > k! and isprime(n+k!) and isprime(n-k!) then return(k) fi od: 0 end proc: a(1):= 0: seq(a(n), n=1..100); # Robert Israel, Aug 10 2014 PROG (PARI) a(n)=forstep(k=n, 1, -1, if(ispseudoprime(n+k!)&&ispseudoprime(n-k!), return(k))) n=1; while(n<150, print1(a(n), ", "); n++) CROSSREFS Cf. A020639, A245716, A241423, A241424. Sequence in context: A298931 A035219 A245716 * A106347 A124300 A154326 Adjacent sequences:  A241422 A241423 A241424 * A241426 A241427 A241428 KEYWORD nonn AUTHOR Derek Orr, Aug 08 2014 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.

Last modified May 26 16:52 EDT 2020. Contains 334627 sequences. (Running on oeis4.)