Integers $n$ such that $n^2$ is of the form $3k+2$

Hint: Write $n$ as $3m+r$ with $m\in\Bbb Z$ and $r\in\{0,1,2\}$


$$n^2 = 3k+2$$

Solving for k:

$$k = \frac{n^2 - 2}{3}$$

For this to be an integer,

$$n^2 - 2 \equiv 0 \mod 3$$ $$n * n \equiv 2 \mod 3$$

The fundamental property of multiplication in modular arithmetic states:

$$(a\ \%\ m) * (b\ \%\ m) \equiv (ab\ \%\ m) \mod m$$

where % is the modulo operator. Therefore:

$$n * n \equiv 2 \equiv (n\ \% \ 3)^2 \mod 3$$

$n\ \%\ 3$ can be either $0$, $1$, or $2$, so $(n\ \%\ 3)^2$ can be either $0$, $1$, or $4$ respectively. None of these are $2$ (mod $3$), so $k$ can never be an integer, regardless of what you choose n to be.