<s>[INST] Prove that $n^7+7$ can never be a perfect square. Prove that for a positive integer $n$, $n^7+7$ cannot be a perfect square.
I managed to show that $n \equiv 5 \pmod{8}$ or $n \equiv 9 \pmod{16}$. But nothing came from that so I presume another approach is needed???
Thanks for any help.
 [/INST] To show that $n^7 + 7 = x^2$ has no solution we shall use the fact that
$n^7 - 7 = x^2$ has one solution namely $n = 2$ and $x = 11$.
Suppose $n^7 + 7 = x^2$. Adding to $2^7 - 7 = 11^2$ we get
$
n^7 + 2^7 = x^2 + 11^2
$
Call $m = n + 2$. Then
$
n^7 + 2^7 = (m - 2)^7 + 2^7 =
$
$$\sum_{0 \le k \le 7} \binom{7}{k} m^k (-2)^{7-k} + 2^7$$
$$ = \sum_{1 \le k \le 7} \binom{7}{k}(-1)^{k-1} m^k (2)^{7-k} $$
$m$ can be factored out and you get
$$n^7 + 2^7 = m \sum_{1 \le k \le 7} \binom{7}{k} (-1)^{k-1} m^{k-1} (2)^{7-k}$$
Let's write $n^7 + 2^7 = m\cdot M.$
Note that $M = m^6 -7\cdot 2\cdot m^5 + - + -21\cdot 2^5m + 7\cdot 2^6$
Hence $\gcd(m,M)$ is a divisor of $7\cdot 2^6$
Note that in $\Bbb{Z}_4$, the squares are $0$ and $1$. Hence $n^7 + 7 = 0$ or $1$ in $\Bbb{Z}_4$, which implies that $n$ is odd.
This implies that $m$ is odd. Hence $\gcd(m,M)$ is either $1$ or $7$.
Observe that in $\Bbb{Z}_7$, the squares are $0,1,2,4$. Hence the sum of $2$ squares can be a multiple of $7$ only if both squares are themselves multiples of $7$. Since $11$ is not, $x^2 + 11^2$ can't be a multiple of $7$.
Therefore $\gcd(m,M)=1$
Now if $m \cdot M$ is a sum of $2$ squares, its square free part has prime factors only of the form $p = 4k + 1$.
Hence the same is true for m, since $\gcd(m,M) = 1$.
This implies that $m = 1 \pmod 4$ and $n = m - 2 = - 1 . \pmod 4$
Hence $n^7 + 7 = -1 -1 = 2 \pmod 4$ and is not a square.
This yields a contradiction: $n^7 + 7$ can't be a square.
</s>