Friday: found a new arXiv item near to this, Haensch Kane. There has been a fair amount of activity in this general area of late, for example Kane and Sun on mixed sums of triangular numbers and squares. Apparently Guy showed that every positive number is the sum of three pentagonal numbers.
Apparently this is discussed in SUN. My first impression is that he could not prove it either; he did prove it if all the variables are allowed to be negative when needed.
Thursday: below is a proof that the ternary form $x^2 + 6 y^2 + 12 z^2$ does something desirable. The original question follows (maybe) from this. It will take me a bit to type that last part in.
Alrighty, using $t$ for triangle, $s$ for square, $p$ for pentagon, we want
$$ \frac{t^2 + t}{2} + s^2 + \frac{3p^2 - p}{2 } = n. $$
Multiply by $8$ and add $1$ to both sides, we have
$$ (2t+1)^2 + 8 s^2 + 12 p^2 - 4p = 8n+1 $$
Multiply by $3$ and add $1$ to both sides, we have
$$ 3(2t+1)^2 + 24 s^2 + (6p-1)^2 = 24n+4. $$
One fourth of $24n+4$ is $6n+1.$ Take
$$ u^2 + 12 v^2 + 6 w^2 = 6n+1, $$
$$ u^2 + 3 (2 v)^2 + 6 w^2 = 6n+1. $$
Hmmmm.
Let me put what I've got next, which i assumed was enough last night: Take $u,v,w \geq 0.$ Note $u$ is odd and prime to $3.$
If $u \equiv 2 \pmod 3,$
$$ (u+6v)^2 + 3 (|u-2v|)^2 + 24 w^2 = 24 n+4. $$
If $u \equiv 1 \pmod 3$ and $u < 6v,$
$$ (6v -u)^2 + 3 (u+2v)^2 + 24 w^2 = 24 n+4. $$
If $u \equiv 1 \pmod 3$ and $u > 6v,$ more work is needed. Hmmm.
====================================================================
Wednesday: Make an answer; this is my area. Your question follows from the fact that, given integer $n \geq 0,$ we can always write
$$ 6n+1 = u^2 + 6 v^2 + 12 w^2 $$
in integers.
The ternary form $ u^2 + 6 v^2 + 12 w^2 $ is not regular. Up to a million, there are some ten numbers that are not represented by the form, but instead are represented by the other form in the genus, that being $3 u^2 + 4 v^2 + 6 w^2.$ These sporadic numbers are, however, all multiples of three.
3 39 51 69 165 219
399 561 771 1941
Taken together, the forms of the genus represent all positive integers except $3k+2$ and $4^k (16m+14).$ Compare the form $1,3,6$ in Dickson's table:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/bkPyG.jpg)
The composition of the genus is shown in this excerpt
B.-I.discr = -288 = -1 *2^5 *3^2
1^-1 3^-2
[2^1 4^1 8^1]_3
616: 1 6 12 0 0 0
631: 3 4 6 0 0 0
2^-2_4 16^-1_3
613: 1 3 24 0 0 0
637: 4 4 7 2 4 4
2^-2_2 16^-1_5
632: 3 4 7 4 0 0
2^2_2 16^1_1
619: 1 9 9 6 0 0
from http://www.math.rwth-aachen.de/~Gabriele.Nebe/LATTICES/Brandt_1.html
Here is a page with pdfs about positive ternary quadratic forms
Proof of fact above....
Lemma (Burton Wadsworth Jones, 1928 dissertation) If we have a nonzero integer $k$ with $k=r^2 + 2 s^2,$ and $k$ is a multiple of $3,$ there is another representation $k = x^2 + 2 y^2$ with both $x,y$ prime to $3.$
We can also prove this by induction on the power of $3$ dividing $k.$
Theorem: if $m \equiv 1 \pmod 6$ and $n > 0,$ we can always write
$m = u^2 + 6 v^2 + 12 w^2 $ in integers.
Proof We may assume that $m$ is represented by the other form of the genus, so we have $m = 3 u^2 + 4 v^2 + 6 w^2.$ It follows that $v \neq 0 \pmod 3.$ We have four similar formulas,
$$ 9m = (3u+6w)^2 + 6(-u + 2v+w)^2 + 12 (-u-v+w)^2$$
$$ 9m = (3u-6w)^2 + 6(-u + 2v-w)^2 + 12 (-u-v-w)^2$$
$$ 9m = (3u+6w)^2 + 6(u + 2v-w)^2 + 12 (u-v-w)^2$$
$$ 9m = (3u+6w)^2 + 6(u + 2v+w)^2 + 12 (u-v+w)^2$$
If at least one of $u,w$ is not divisible by $3,$ then at least one of the four formulas has all three items that are being squares divisible by $3.$ Therefroe we may divide them by $3$ and move $9m$ to $m$ itself.
If both $u,w$ are divisible by $3,$ then the Jones Lemma says that we can revise the representation so that both $u,w$ are prime to $3.$ as a result, in the revision, at least one of the four formulas is made up of numbers divisible by $3.$
$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$