Every nonnegative integer can be written (eventually in many ways) as a sum of three triangular numbers by the Gauss Eureka theorem.

What is the smallest positive integer $n=n_m$ which can

notbe written in the form $$n=\binom{a}{2}+\binom{b}{2}+\binom{c}{2}.$$ subject to $\max(a,b,c) \le m?$

The answers for $m$ from $1$ to 60 are

$ \begin {array}{cccccccccc} 1&4&8&11&24&29&29&47&68&68 \\\95&99&137&141&173&173&245&281&314&314 \\\314&407&419&419&470&470&617&617&711&800 \\\863&911&911&911&911&1118&1118&1118&1118&1118 \\\1383&1433&1433&1679&1679&1679&1868&1868&1868&1868 \\\1868&2360&2493&2493&2519&2925&3044&3044&3098&3098 \end {array} $

The sequence does not seem to be in the OEIS even with a superseeker search. It just seems a curious sequence. Any information would be welcome. What bounds or asymptotics can be established? It would appear that $n_m \lt m^2$ although $m_{105}=11018 \lt 11025=105^2$ leaves some doubt. I'd conjecture (rashly) that $$\limsup \frac{n_m}{m^2}=1$$ but $n_{110}=n_{111}=n_{112}=n_{113}=11625$ and $\frac{11625}{113^3} \approx 0.91$ so the $\liminf$ might be less. I wonder what explains the repeated values and what can be said about them.

**UPDATE** Noam makes a nice argument that $\lim \frac{n_m}{m^2}=3/2.$ I'd accept it if it was an answer and not a comment. Let me spell out that $8\binom{t}{2}+1=(2t+1)^2$ so $n=\binom{a}{2}+\binom{b}{2}+\binom{c}{2}$ exactly if $8n+3=(2a+1)^2+(2b+1)^2+(2c+1)^2$ and this allows one to pull in results on sums of squares.

I still don't see why things such as $n_{36}=n_{37}=n_{38}=n_{39}=n_{40}$ happen, but I have not thought about it very deeply.

For any fixed $k$, $n_m \lt \frac{3m^2}{2}-km$ with finitely many exceptions. so one could wonder about things like $\frac{3m^2}{2}-\sqrt{m^3}.$ However this result was great for the problem I wanted to apply it to. I would have mentioned the connection sooner but the answer came before I ggot to that.