<s>[INST] Number theory proofs regarding perfect squares How do you prove that $3n^2-1$ is never a perfect square
 [/INST] Another approach. First establish that perfect squares are either $0$ or $1$ modulo $4$:
$$(2k)^2 = 4k^2 \equiv 0\pmod 4$$
$$(2k+1)^2 = 4k^2 + 4k + 1 \equiv 1 \pmod 4$$
If $n$ is even, $n = 2m$ and,
$$3n^2 - 1 = 12m^2 - 1 \equiv -1 \equiv 3 \pmod 4$$
If $n$ is odd, $n = 2m+1$ and,
$$3n^2 - 1 = 12m^2 + 12m + 3 - 1 \equiv 2 \pmod 4$$
In neither case is the condition for a perfect square modulo $4$ met.
Hence $3n^2 - 1$ is never a perfect square.
</s>