Investigating about Giuga's conjecture, I read that it has been showed that any counterexample to Giuga conjecture needed to meet the following condition:
$$p\mid\frac{n}{p}-1$$ for each prime divisor $p$ of $n$.
Giuga also showed that every counterexample to Giuga conjecture must be squarefree, it should be also a Carmichael number, and finally, he showed that any counterexample $G$ must satisfy that
$$\sum_{p\mid G}\left(\frac{1}{p}\right)-\prod_{p\mid G}\left(\frac{1}{p}\right)\in\mathbb{N}$$
I have been thinking about improving this result to show that every counterexample $G$ must satisfy that
$$\sum_{p\mid G}\left(\frac{1}{p}\right)-\prod_{p\mid G}\left(\frac{1}{p}\right)=1$$ I would be glad if someone could review the following proof of the above stated:
Proof
It is easy to see that the condition $p\mid\frac{G}{p}-1$ is equivalent to $p^{2}\mid G-p$. Therefore, we have that
$$G^{2}\mid\prod_{p\mid G}\left(G-p\right)$$
Expanding, we have that
$$\prod_{p\mid G}\left(G-p\right)=G^{n}-G^{n-1}\left(p_{1}+p_{2}+...+p_{n}\right)+...+\left(-1\right)^{n-1}G\left(\frac{G}{p_{1}}+\frac{G}{p_{2}}+...+\frac{G}{p_{n}}\right)+\left(-1\right)^{n}G$$
As $G^{2}$ divides directly each term of the expansion excepting the last two ones, we get that
$$G^{2}\mid\prod_{p\mid G}\left(G-p\right)\Leftrightarrow G^{2}\mid\left(-1\right)^{n-1}G\left(\frac{G}{p_{1}}+\frac{G}{p_{2}}+...+\frac{G}{p_{n}}\right)+\left(-1\right)^{n}G$$
It can be seen that
$$G^{2}\mid\left(-1\right)^{n-1}G\left(\frac{G}{p_{1}}+\frac{G}{p_{2}}+...+\frac{G}{p_{n}}\right)+\left(-1\right)^{n}G\Leftrightarrow\left(\frac{G}{p_{1}}+\frac{G}{p_{2}}+...+\frac{G}{p_{n}}\right)=G^{k}+1$$
Where $k$ is some positive integer.
As
$$\left(\frac{G}{p_{1}}+\frac{G}{p_{2}}+...+\frac{G}{p_{n}}\right)=G\left(\frac{1}{p_{1}}+\frac{1}{p_{2}}+...+\frac{1}{p_{n}}\right)$$
We get that if $k>1$, as $G\left(\frac{1}{p_{1}}+\frac{1}{p_{2}}+...+\frac{1}{p_{n}}\right)=G^{k}+1$, we would get that $\frac{1}{p_{1}}+\frac{1}{p_{2}}+...+\frac{1}{p_{n}}>G$, or which is the same, that $$\sum_{p\mid G}\left(\frac{1}{p}\right)>\prod_{p\mid G}p$$
Which is obviously impossible; therefore, the only possible value of $k$ is $k=1$. And thus,
$$G\left(\frac{1}{p_{1}}+\frac{1}{p_{2}}+...+\frac{1}{p_{n}}\right)=G+1$$
Operating, it is easy to get that
$$\sum_{p\mid G}\left(\frac{1}{p}\right)-\prod_{p\mid G}\left(\frac{1}{p}\right)=1$$
As we wanted to prove.
Thanks in advance!