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.

A245756 Least number k such that (k! + n)/k is prime, or 0 if no such k exists.

Original entry on oeis.org

1, 1, 3, 1, 0, 1, 0, 2, 3, 1, 0, 1, 0, 0, 3, 1, 0, 1, 0, 2, 0, 1, 0, 2, 5, 0, 3, 1, 0, 1, 0, 2, 3, 0, 5, 1, 0, 38, 0, 1, 0, 1, 0, 2, 3, 1, 0, 0, 7, 0, 3, 1, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 3, 0, 5, 1, 0, 4, 0, 1, 0, 1, 0, 74, 0, 0, 0, 1, 0, 2, 3, 1, 0, 2, 5, 0, 3
Offset: 1

Views

Author

Derek Orr, Jul 31 2014

Keywords

Comments

If a(n) = n, then n is in A090660.
a(n) <= n for all n.
a(n) = 1 if and only if n + 1 is prime.

Examples

			(1! + 3)/1 = 4 is not prime.
(2! + 3)/2 = 5/2 is not prime.
(3! + 3)/3 = 3 is prime. Thus a(3) = 3.
		

Crossrefs

Cf. A090660.

Programs

  • PARI
    a(n)=for(k=1,n,s=(k!+n)/k;if(floor(s)==s,if(ispseudoprime(s),return(k))))
    n=1;while(n<150,print1(a(n),", ");n++)

Extensions

Corrected by Jens Kruse Andersen, Aug 03 2014