There is a famous theorem in number theory called Wilson's Theorem.
Statement: $n$ satisfies, $(n-1)! + 1 = 0\pmod n$ if and only if $n$ is prime.
Another way of looking at the statement is that, $\dfrac{(n-1)! + 1}{n}$ is an integer only if $n$ is prime.
I have noticed a pattern in these integers. They always come out to be prime. I have made a code, to test primes upto a large number, and all of the integers that have come from the fraction, is found to be prime. If the aforementioned statement always holds true for all primes, then it would behave as a prime generator. I haven't found any useful information currently existing on the internet.
Hence, I am looking for a mathematical proof for the following:
Let $f:\mathbb{N}\to\mathbb{N}$ be defined as, $$f(n) = \frac{(n-1)! + 1}{n}$$for all $n\in\mathbb{N}$.
Prove that: $$f(n)\in \mathbb{P};\ \ \forall n \in\mathbb{P}$$ Where $\mathbb{P}$ is the set of Primes.
Now, I do know that for $n = {2,3},\ f(n) = 1$. This should be ignored as sometimes, $1$ trivially shows up while working with primes.