If an integer $n$ is such that $7n$ is the form $a^2 + 3b^2$, prove that $n$ is also of that form. If an integer $n$ is such that $7n$ is the form $a^2 + 3b^2$, prove that $n$ is also of that form.
I thought that looking at quad residues mod $7$ might??? help. But that didn't take me anywhere so apart from that I'm at a loss. I would appreciate any help. Thanks in advance.

$\text{Make use of the identity }$$$\color{red}{(x^2+3y^2)(u^2+3v^2) = \underbrace{(xu\pm3yv)^2 + 3(xv\mp yu)^2}_{a^2 + 3b^2}}$$
$\text{Now we have}$
$$7 = 2^2 + 3 \times 1^2$$
$\text{i.e., }x=2 \text{ and }y=1$.
$\text{Use this to obtain $u$ and $v$.}$
$\textbf{EDIT}$:
$\text{Here is the full solution. The main claim is that if $7 \vert (a^2+3b^2)$, then}$


*

*Either $7 \vert (a+2b)$ and $7 \vert (2a-3b)$

*Or $7 \vert (a-2b)$ and $7 \vert (2a+3b)$


This can be checked by listing out the different possibilities for $a$ and $b$.
If $7 \vert (a+2b)$ and $7 \vert (2a-3b)$, then set $u = \dfrac{2a-3b}7$ and $v = \dfrac{a+2b}7$.
Else, if $7 \vert (a-2b)$ and $7 \vert (2a+3b)$, then set $u = \dfrac{3b-2a}7$ and $v = \dfrac{a+2b}7$.
This guarantess that $u$ and $v$ are integers. Hence, $\text{$n$ can be written as $u^2+3v^2$.}$
