Let $k$ be a positive integer. Let $$Q= \begin{pmatrix} 1 &1/2& & & & \\ 1/2& 1 & & & & \\ & & 1 &1/2& & \\ & &1/2& 1 & & \\ & & & & 1 &1/2\\ & & & &1/2& 1 \end{pmatrix}. $$ > How many solution $x\in\mathbb Z^6$ are there to $\quad x^tQx=k$? This is equivalent to: > How many solution $x\in\mathbb Z^6$ are there to > $$x_1^2+x_1x_2+x_2^2+ x_3^2+x_3x_4+x_4^2+ x_5^2+x_5x_6+x_6^2=k?$$ or to > How many solution $x\in \mathbb Z\left[\omega \right]^3$ are there to $\quad x^* I_3 x=k$? where $I_3$ is the $3\times3$-identity matrix and $\omega=\frac{1+\sqrt{-3}}{2}$. I know that there is a formula for this number (there is only one class in its genus), but I don't know it. This question is related to - https://mathoverflow.net/questions/78361/which-integers-take-the-form-x2-xy-y2 - https://math.stackexchange.com/questions/44139/how-many-solutions-are-there-to-fn-m-n2nmm2-q/ but they don't answer my question.