The formula that emiliocba seeks seems to be as follows. Let $\chi$ be the Dirichlet character mod $3$. For $k>0$ write $k = 3^e n$ with $n \equiv \pm 1 \bmod 3$. Then the number of representations of $k$ by this quadratic form $A_2^3$ is $$ s(k) := 9 (3^{2e+1}-\chi(n)) \phantom. \sum_{d|n} \phantom. \chi(n/d)\phantom. d^2. $$ I append **gp** code that verifies that this holds for $k \leq 432$. To prove it in general it will be enough to check that $$ \varphi := 1 + \sum_{k=1}^\infty \phantom. s(k) q^k $$ is a modular form of weight $3$ and character $\chi$ for $\Gamma_0(3)$, and to match a few coefficients with the theta function $\theta_{A_2^3}$. In principle, it is enough to match only the $q^0$ coefficient: the dual of $A_2^3$ is isomorphic with the scaling of $A_2^3$ by $1/3$, so by Poisson summation $\theta_{A_2^3}$ is modular also for the normalizer $\Gamma_0^+(3)$ of $\Gamma_0(3)$ (generated by $\Gamma_0(3)$ and the involution $w_3 : \tau \longleftrightarrow -1/3\tau\phantom.$); and $\Gamma_0^+(3)$ has only one cusp, and no cusp forms of weight less than $6$ (the weight of $\eta(\tau)^6 \eta(3\tau)^6$), so the normalized Eisenstein series $\varphi$ is the only candidate for $\theta_{A_2^3}$. H = 24 A2 = sum(m=-H,H,sum(n=-H,H,q^(m^2+m*n+n^2))) + O(q^(3*H^2/4+1)); L = A2^3; chi3(m) = kronecker(m,3) { s(k, e,n) = e = valuation(k,3); n = k / 3^e; 9 * (3^(2*e+1)-chi3(n)) * sumdiv(n, d, chi3(n/d)*d^2) } L == 1 + sum(k=1,3*H^2/4,s(k)*q^k)