I've read this post asking the same question.

Since I can't comment on that thread and have trouble understanding the proof, I'm starting this thread.

I understand that there are perfect squares that are divisible by 5 and I also understand that

$(n^2+2) mod 5\equiv 2,3 \Rightarrow 5 \nmid (n^2+2)$,

but why does that mean $5(n^2+2)$ can not be a perfect square?

  • 2
    $\begingroup$ If a prime $p$ divides $a^2$, then it divides $a$. But then $p^2$ must divide $a^2$. In your case $p=5$ divides $5(n^2+2)$, but $5^2$ doesn't divide it. $\endgroup$
    – EEE
    Oct 15, 2017 at 18:55
  • $\begingroup$ @EEE Thank you, $p^2$ must divide $a^2$ since we assume $a^2$ is a perfect square, right? $\endgroup$
    – Meik Vtune
    Oct 15, 2017 at 19:05

1 Answer 1


If a number $t$ is a perfect square, it is the square of some integer, so let that integer be $k$, i.e. $t=k^2$, now since $5|t$, $5|k$ so $5$ is in $k$'s prime facorisation, therefore $n$ must be $5^2$(some integer), i.e. $25|t$
If $5(n^2+2)$ is not divisible by $25$, you are done. That is , when $5$ does not divide $n^2+2$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .