In the course of pondering this question I noticed that $4[(c+1)^3 – c^3]$ can be represented in the form $p^2 + 3q^2$ in three different ways:
$$4[(c+1)^3 – c^3] = 12c^2 + 12c + 4$$
$$= 1^2 + 3(2c+1)^2$$
$$= (3c+1)^2 + 3(c+1)^2$$
$$= (3c+2)^2 + 3c^2$$
This property also holds for some other integers not of the above form, for example:
$$52 = 7^2 + 3(1^2)$$
$$= 5^2 + 3(3^2)$$
$$= 2^2 + 3(4^2)$$
Other small integers with this property are $124$ and $172$. In each case the three representations are related by the identity:
$$p^2 + 3q^2$$
$$= \bigg(\dfrac{p+3q}{2}\bigg)^2 + 3\bigg(\dfrac{p-q}{2}\bigg)^2$$
$$= \bigg(\dfrac{p-3q}{2}\bigg)^2 + 3\bigg(\dfrac{p+q}{2}\bigg)^2\qquad(1)$$
This yields integers whenever $p$ and $q$ are both odd or both even. If any one representation is known, the other two can be readily calculated.
There are also integers which can be represented in the form $p^2+3q^2$ in six different ways, including $364$, $532$ and $868$. In each case the six ways can be divided into two groups of three, each exemplifying identity (1). For example:
$$364 = 19^2 + 3(1^2)$$
$$= 11^2 + 3(9^2)$$
$$= 8^2 + 3(10^2)$$
$$364 = 17^2 + 3(5^2)$$
$$= 16^2 + 3(6^2)$$
$$= 1^2 + 3(11^2)$$
Question: For integers representable in the form $p^2+3q^2$ in two groups of three ways, each group an instance of identity (1), is there any algebraic relation between the two groups (which would enable all the other five to be calculated if any one were known)?


