cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Derek Orr, Jul 30 2014

Keywords

Comments

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

Examples

			7 + 1! = 8 is not prime.
7 + 2! = 9 is not prime.
7 + 3! = 13 is prime. Thus a(7) = 3.
		

Crossrefs

Cf. A245723.

Programs

  • PARI
    a(n)=for(k=1,n,if(ispseudoprime(n+k!),return(k)))
    vector(150,n,a(n))
Showing 1-1 of 1 results.