$4q=a^2+27b^2$ elementary proof of uniqueness

Hint:

$\Bbb Z[\omega]$, with $\omega^2+\omega+1=0$, is a UFD.

Suppose $$\frac{a^2+27b^2}{4}=\frac{c^2+27d^2}{4}\tag{1}$$ $\Bbb Z[\omega]$ is a UFD, so factor as $(1)$ $$\left(\frac{a+3b\sqrt{-3}}{2}\right)\left(\frac{a-3b\sqrt{-3}}{2}\right)=\left(\frac{c+3d\sqrt{-3}}{2}\right)\left(\frac{c-3d\sqrt{-3}}{2}\right)$$ Each factor is a prime in $\Bbb Z[\omega]$ since $N\left(\frac{a+3b\sqrt{-3}}{2}\right)=q$, therefore the factors are associates.

Can you take it from here?


Suppose that $4q=a^2+27b^2=c^2+27d^2$ and $a,b,c,d> 0$ (equals 0 is not possible).

We have $a^2d^2-b^2c^2\equiv 0 $ mod $q$.

Then $(ad-bc)(ad+bc)\equiv 0$ mod $q$.

If $ad+bc\equiv 0$ mod $q$, then by $16q^2=(a^2+27b^2)(c^2+27d^2)=(ac-27bd)^2+27(ad+bc)^2$, we must have $ad+bc=0$. This is impossible, so we have $ad-bc \equiv 0 $ mod $q$.

By $16q^2=(a^2+27b^2)(c^2+27d^2)=(ac+27bd)^2+27(ad-bc)^2$,

we have $ad-bc=0$. Thus, $a/c=b/d=t$ gives $a^2+27b^2=t^2(c^2+27d^2)=c^2+27d^2$. Hence, $t^2=1$ and $t=\pm 1$. Since $a,b,c,d> 0$, we must have $a=c$ and $b=d$.