The Chinese hypothesis revisited

In the past I tried to get different variations of the so-called Chinese hypothesis, see this Wikipedia (a disproven conjecture).

Today I wanted to combine in an artificious way also Wilson-Lagrange theorem to prove next claim.

Claim. If $n$ is prime then $$((n-1)!+3)^n\equiv 2\text{ mod }n.\tag{1}$$

Sketch of the proof. It is obvious from Wilson-Lagrange $LHS\equiv 2\cdot 2^{\varphi(n)}\text{ mod }n$, where $\varphi(n)$ is the Euler's totient.$\square$

Question. I don't know if it is obvious that:

If an integer $n$ satisfies $((n-1)!+3)^n\equiv 2\text{ mod }n$ then $n$ is a prime number.

Can you find such easy proof for previous statement, or well refute it with a conunterexample? Thanks in advance.

Now I'm stuck about how to prove it, if is right. I tested the first few integers with this code

mod(((n-1)!+3)^n, n), from n=1 to 100

• If some user is interested in the past I tried to get variations of the Chinese hypothesis writing different arithmetical functions $a(n)$ instead of $n$ in the statement of the Chinese hypothesis. I say this, if some user is interested to explore it. – user243301 Feb 15 '18 at 23:00
• By the binomial expansion your expression is always congruent to $3^n+(n-1)!^n \bmod n$. – Arnaud Mortier Feb 15 '18 at 23:13
• Also, if $n$ is not a prime then the second term is $0$ and you are left to prove that $3^n$ is not $2$. – Arnaud Mortier Feb 15 '18 at 23:22
• By the way, use \mod n to generate $\mod n$ or use \pmod n to generate the modulus with parantheses, i.e. $\pmod n$. – Feeds Feb 15 '18 at 23:59
• Mnay thanks @user477343 – user243301 Feb 16 '18 at 9:14

One counterexample is $n=2929 = 29\times 101$.
Note that $2928! = 0 \mod 2929$, so the given statement is equivalent to $3^{2929} = 2 \mod{2929}$. This can be checked by computer, although checking by hand is feasible by use of the Chinese Remainder Theorem and Fermat's Little Theorem.
• The statement is equivalent to $3^n=2\mod n$ in all non-prime cases. – Arnaud Mortier Feb 16 '18 at 0:05