# Twin primes and modulo

I am so exited to learn math from this site. I posted the question today and I got good replies from members today itself. I will try to answer other number Theory questions in near future. With same confidence and motivation, I am sending TWO more questions to the members. These are also my observations and it may be done by simple proofs.

1) for a positive odd integer $p$, and $p_1$, $p_2$ - two different odd primes, and $p_1+p_2 - p = 1$ then $(p - p_1)!(p - p_2)! = -1 (\mod p)$ iff $p$ is prime.

2) For a prime $p > 7$, $(p,p +2)$ are said to be twin pair primes iff $4(p-3)! + (p + 2)$ divides $p$.

• It seems you already know how to use $\TeX$ here. Please format the entire equations, not just the parts with subscripts; it makes for a rather bumpy reading experience when some parts are properly typeset and others aren't. – joriki Nov 10 '12 at 9:20
• What do you mean by $p_1+p_2+p=1$? This can't hold in $\mathbb Z$, and if it's meant to be under the scope of $\pmod p$, then the summand $p$ is redundant. Also, how are you using "are said to be" in the second statement? It doesn't make sense to me as it stands. Do you mean to say simply that they are twin primes? – joriki Nov 10 '12 at 9:22
• SHIT what a mistake I made. Please see my edited question 1. – madfellow Nov 10 '12 at 9:45
• @joriki!I perfectly edited my question number 1. – madfellow Nov 10 '12 at 9:51
• Why are you posting two different problems in the same thread? Also, are these problems something you are thinking about for a specific reason? It would help if you provided some context, particularly about what you have tried until now [see the guide on how to post good questions]. Have a good day! – Andrea Orta Nov 10 '12 at 9:54

Statement 2) is strange --- $4(p-3)!+p+2$ can't possibly divide $p$, since it's bigger than $p$. Perhaps something has gone wrong during an edit.

For 1), first note that $$n!\equiv(-1)^n(p-1)(p-2)\cdots(p-n)\equiv{(-1)^n(p-1)!\over(p-n-1)!}\pmod p$$ so $$n!(p-n-1)!\equiv(p-1)!\equiv-1\pmod p$$ if $n$ is even and (using Wilson's Theorem) $p$ is prime. Now let $n=p-p_1$ (which is even) and note that $p_1-1=p-p_2$ to get one direction.

For the other direction, note that if $p$ is not prime, then it is divisible by some prime $q\le(p-1)/2$. We can't have both $q\gt p-p_1$ and $q\gt p-p_2$ (since that, together with $p_1+p_2-p=1$ would contradict $q\le(p-1)/2$), so $q$ must divide at least one of $(p-p_1)!$ and $(p-p_2)!$, whence their product can't be $-1\bmod p$.

I do not know your statement (1), but your statement (2) is false.

Because your $$4(p-3)!+(p+2)\equiv0\pmod p$$ is actually equivalent to Wilson's theorem, i.e., $p$ is a prime iff $$(p-1)!+1\equiv0\pmod p$$

So when you choose $p=47$, then your statement (2) holds. However $p+2=49=7\times7$ is not a prime.

• !Discuss the necessary and sufficient condition for except the case p = 7. in my second problem. – madfellow Nov 10 '12 at 9:40
• ! Kindly look my edited post. – madfellow Nov 10 '12 at 9:51
• It is an exception for $p=47$? I am not talking about $p=7$ case. If you are still not convinced try $p=103$, you will have $4(103-3)!+(103+2)\equiv0\pmod {103}$. However $p+2=105=3\times5\times7$, so another counter example because $(103, 105)$ is not a twin prime pair, but you stated that your condition is necessary and sufficient. – AmFCG Nov 10 '12 at 11:42