# Is $(p-1)!+p$ a prime for every prime $p$?

Is $(p-1)!+p$ a prime for every prime $p$? It looks unlikely but I cannot get an example that will do. Also by trying to prove it by assuming a prime factor greater than $p$ and less than $(p-1)!+p$, I am not getting anything. Some more techniques of proof that may help or even a direct answer is appreciated.

• @Coolwater for every prime $p$ Jan 29, 2016 at 17:40
• So far as I know there is no known prime number generator. Not being able to come up with a counter example isn't a good reason to think something is true. Jan 29, 2016 at 17:42
• @fleablood There are many prime number generators, starting with Euclid's algorithm. What you probably mean is there are no efficient prime number generators. Jan 29, 2016 at 17:44
• Probably I do mean that. How is Euclid's algorithm a prime number generator? I suppose the simplest way to find primes would be to simply go through every number and check whether it is prime or not but that can't be said to "generate" primes can it? Jan 29, 2016 at 17:55
• @fleablood Yes, that is a prime generator :) Anything you can write in a list comprehension (and more) can be said to be a prime number generator. In Maths, you don't care how a function generates its output. Its a black box. If that black box is the Sieve Of Eratosthenes and F(5) is just the 5th prime the sieve spits out, it is a prime generator function. You don't care that it doesn't efficiently compute it because it is a line on a piece of paper and not a computer churning out madly.
– Lan
Jan 29, 2016 at 18:28

You just didn't go far enough. While $(p-1)! + p$ is prime for $p = 2, 3, 5, 7,$ and $11$, it is composite for $p = 13, 17, 19, 23, 29, 31, 37, 41, 43,$ and $47$. $p = 53$ is the next prime for which it is true.
• In fact, this accounts for all of the primes of this form for $p < 1250$. See oeis.org/A100858 Jan 29, 2016 at 17:46
$$12!+13=29\cdot 2503\cdot 6599$$