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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245716 Least number k > 0 such that n + k! and n - k! are both prime, or 0 if no such k exists. 3
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, 3, 0, 3, 0, 2, 0, 0, 1, 4, 0, 2, 0, 3, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 3, 0, 2, 0, 0, 1, 3, 0, 0, 0, 3, 0, 0, 0, 2, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 1, 3, 0, 2, 0, 3, 1, 0, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

For a(n) > 0, a(n)! < n for all n. Thus a(n) = 0 is definite.

LINKS

Jens Kruse Andersen, Table of n, a(n) for n = 1..10000

EXAMPLE

13 + 1! and 13 - 1! are not both prime.

13 + 2! and 13 - 2! are not both prime.

13 + 3! and 13 - 3! are both prime (19 and 7). Thus a(13) = 3.

PROG

(PARI)

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

vector(150, n, a(n))

CROSSREFS

Cf. A245714, A245715.

Sequence in context: A035225 A298931 A035219 * A241425 A106347 A124300

Adjacent sequences:  A245713 A245714 A245715 * A245717 A245718 A245719

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 May 31 16:29 EDT 2020. Contains 334748 sequences. (Running on oeis4.)