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.
 A: 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.
A: Here is an alternative proof that is hopefully slightly simpler.
We will make use of a simple theorem whose proof is skipped here:
For any odd integer number $m$, we have $m^2\equiv 1(mod 4)$.
Assume on the contrary, $n^7+7$ is a perfect square, then there exists an integer $x$ such that $n^7+7=x^2$.
If $x$ is odd, $n$ would have to be even. And the left side would be $3 (mod 4)$ that contradicts the fact that the right side is $1 (mod 4)$ by the theorem above. So $x$ has to be even, and $n$ has to be odd. Further more, applying the above theorem on $n^6=(n^2)^3$, we know $n^7\equiv n (mod 4)$. Note the right hand size is $0 (mod 4)$ since $x$ is even, we must have $$n\equiv 1 (mod 4).$$
Let's denote $x=2b$ where $b$ is another positive integer. Now we get $n^7+7=4b^2$. Further utilizing the fact that $7=2^7-11^2$. We can rewrite the above equation as $n^7+2^7=4b^2+11^2$, or
$$(n+2)(n^6-2n^5+4n^4-8n^3+16n^2-32n+64)=4b^2+11^2.$$
Now, notice $n+2\equiv 3 (mod 4)$, it MUST have a prime factor $p$ with $p \equiv 3 (mod 4)$, and $p \mid (4b^2+11^2)$. We next consider two cases:
Case one: $11 \nmid b.$
Since $p \mid (4b^2+11^2)$, we know $p \neq 11$, $p \nmid b$,  $4b^2 \equiv -11^2(mod p)$. Note $\frac{p-1}{2}$ is odd, ${\left(4b^2\right)}^{\frac{p-1}{2}} \equiv {\left(-11^2\right)}^{\frac{p-1}{2}}(mod p)$, ${(2b)}^{p-1}=-11^{p-1}(mod p)$. Applying Fermat's little theorem, we get $1 \equiv -1 (mod p)$, a contradiction.
Case two: $11 \mid b.$
Let $b=11 \times a$, $a$ is an integer. We have
$$ (n+2)(n^6-2n^5+4n^4-8n^3+16n^2-32n+64)=(4a^2+ 1)\times 11^2. $$
We can manually verify that 
$$ 11 \nmid n^6-2n^5+4n^4-8n^3+16n^2-32n+64 $$ for $n \equiv -5 (mod 11)$ to $n \equiv 5 (mod 11).$ Hence $11^2 \mid n+2.$ Note $11^2 \equiv 1(mod 4)$, we still have the claim that $\frac{n+2}{11^2}$ has a prime factor $p$ with $p \equiv 3(mod 4)$, and $p \mid 4a^2+1$. 
$$ 4a^2 \equiv -1 (mod p)\\ {\left(4a^2\right)}^{\frac{p-1}{2}} \equiv -1 (mod p) \\ {\left(2a\right)}^{p-1} \equiv -1 (mode p) \\ 1 \equiv -1 (mod p),$$
a contradiction.
A: probably easier than previous solutions:
Suppose that $n^7+7=x^2, x \in \mathbb{N}$ has a solution. Then we must have that $x^2+11^2=x^2+121=n^7+128=n^7+2^7$. Now $n+2|n^7+2^7=x^2+11^2$. If $11|n+2$, then $\nu_{11}(n^7+2^7)=\nu_{11}(n+2)$. This also means that $11|x^2+11^2 \implies 11|x$. Let $x=11y$, then we get $\nu_{11}(n+2)=\nu_{11}(n^7+2^7)=\nu_{11}(x^2+11^2)=2+\nu_{11}(y^2+1)=2$ since $-1$ is a quadratic non residue modulo $11$( because $11 \equiv 3 \pmod{4}$). If $11\not|n+2$ then obviously $\nu_{11}(n+2)=0$. in any case $\nu_{11}(n+2)$ is even. Consider any prime $p$ apart from $11$ dividing $n+2$, we must have that $x^2 \equiv -11^2 \pmod{p} \implies (x \cdot (11^{-1}))^2 \equiv -1 \pmod{p} \implies p \equiv 1 \pmod{4}$ because $-1$ is a quadratic residue  for only those primes which are $\equiv 1 \pmod{4}$. Hence we get $$n+2 \equiv 11^{2k}\equiv 1 \pmod{4} \implies n \equiv -1 \pmod{4}$$ where $k=0,1$. But then $x^2=n^7+7 \equiv 7-1 \equiv 2 \pmod{4}$ which is clearly false. Hence we are done.
