I'm trying to prove the following conjecture concerning twin primes and Euler's totient function, which I have verified for $n$ up to 1 billion.
For all $n \in \mathbb{N}$, $n+1$ and $n \phi (n) + 1$ are both perfect squares if and only if $n$ is a product of twin primes.
If is easy. Suppose $n = pq$ for primes $p$ and $q$ with $q=p+2$. Then
\begin{eqnarray} n+1 &=& pq + 1\\ &=& p(p+2) + 1\\ &=& (p+1)^2 \end{eqnarray}
and
\begin{eqnarray} n \phi (n) + 1 &=& pq(p-1)(q-1) + 1\\ &=& p(p+2)(p-1)(p+1) + 1\\ &=& p^4 + 2p^3 - p^2 - 2p + 1\\ &=& (p^2 + p -1)^2 \end{eqnarray}
I'm struggling with only if.
We know from $n = x^2 -1 = (x+1)(x-1)$ that $n$ must have a factor pair separated by 2. Based on the nature of the totient function I tried considering different cases based on the structure of the prime factorization.
In the case that $n$ is a semiprime we are done as the two factors must be twin primes, however, in the the case $n=pqr$, I get stuck. Suppose that $pq = r +2$ and we need to show that
\begin{eqnarray} n \phi (n) + 1 &=& pqr(p-1)(q-1)(r-1) + 1\\ &=& pq(pq-2)(p-1)(q-1)(pq-3) + 1 \\ &=& p^{4}q^{4}-p^{4}q^{3}-p^{3}q^{4}-4p^{3}q^{3}+5p^{3}q^{2}+5p^{2}q^{3}+p^{2}q^{2}-6p^{2}q-6pq^{2}+6pq + 1 \end{eqnarray}
cannot be a square. I tried evaluating the expression modulo small primes but it didn't appear useful. Is there a better approach to solving this case?
Is there a better way to approach the conjecture in general?