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!)
A245714 Least number k > 0 such that n + k! is prime, or 0 if no such k exists. 4
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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

LINKS

Vaclav Kotesovec, Table of n, a(n) for n = 1..5000

EXAMPLE

7 + 1! = 8 is not prime.

7 + 2! = 9 is not prime.

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

PROG

(PARI)

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

vector(150, n, a(n))

CROSSREFS

Cf. A245723.

Sequence in context: A181816 A113738 A287854 * A092953 A058574 A112165

Adjacent sequences:  A245711 A245712 A245713 * A245715 A245716 A245717

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 30 20:17 EST 2021. Contains 349425 sequences. (Running on oeis4.)