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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245715 Least number k > 0 such that n - k! is prime, or 0 if no such k exists. 3
0, 0, 1, 1, 2, 1, 2, 1, 2, 0, 3, 1, 2, 1, 2, 0, 3, 1, 2, 1, 2, 0, 3, 1, 2, 4, 4, 0, 3, 1, 2, 1, 2, 0, 3, 0, 3, 1, 2, 0, 4, 1, 2, 1, 2, 0, 3, 1, 2, 0, 0, 0, 3, 1, 2, 0, 0, 0, 3, 1, 2, 1, 2, 0, 3, 0, 3, 1, 2, 0, 4, 1, 2, 1, 2, 0, 3, 0, 3, 1, 2, 0, 4, 1, 2, 0, 0, 0, 3, 1, 2, 0, 0, 0, 3, 0, 4, 1, 2, 0, 0, 1, 2, 1, 2, 0, 3, 1, 2, 1, 2, 0, 3, 1, 2, 0, 0, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
a(n)! < n for all n. Thus a(n) = 0 is definite.
LINKS
EXAMPLE
11 - 1! = 10 is not prime.
11 - 2! = 9 is not prime.
11 - 3! = 5 is prime. Thus a(11) = 3.
PROG
(PARI)
a(n)=for(k=1, n, if(ispseudoprime(n-k!), return(k)))
vector(150, n, a(n))
CROSSREFS
Sequence in context: A274820 A230583 A197366 * A337736 A047885 A072731
KEYWORD
nonn
AUTHOR
Derek Orr, Jul 30 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 23 09:53 EDT 2024. Contains 375378 sequences. (Running on oeis4.)