Prove $n! +5$ is not a perfect square for $n\in\mathbb{N}$

When $n\geq 3$ $$n!+5 \equiv 2 \pmod{3}$$ So it cannot be a perfect square when $n\geq 3$.


As you can see from pisco125's brilliant answer, the step in which you deduce $n! + 5 = 15k + 5$ for $n \geq 5$ is in this case unnecessary.

With factorials you can usually rely on the fact that $d \mid n!$ for all $n \geq d$. This means $n!$ is divisible by 5 for all $n \geq 5$. Then, although 25 is a bigger modulo than 3 or 15, it's very convenient here, because if $m \equiv 5 \pmod{10}$, then $m^2 \equiv 0 \pmod{25}$. That is to say, 5 is not a square modulo 25. Of course this way you still have to check $n < 10$, whereas pisco's way you need only check $n < 3$.


It's rarely the most elegant way, but with factorials the most intuitive way is by looking at them modulo a power of $10$, such as $100$ or $1000$.

Thus $n! + 5 \equiv 5 \pmod{100}$ for $n > 9$. We know, since it is obvious, that $x^2 \equiv 5 \pmod{100}$ has no solution in integers.

Like I said, it's not elegant, because we still have to look at $n < 10$. We have $$6, 7, 11, 29, 25, 25, 45, 65, 25, 5$$ of which some of them might be squares (the $25$s), but turn out not to be very soon after we think about them.