squares which are not the sum of a square and twice a triangular number I'm trying to determine conditions on integer squares which cannot be written as a square and twice a triangular [all numbers positive], i.e. integers $n \ge 1$ where there are no integers $a,b \ge 1$ such that
$$ n^2 = a^2 + b^2+b.$$
For example, $$9 = 1^2 + 8 = 2^2 + 5,$$ so it is such a number; however, $16=2^2 + (2 \cdot 6)$, so it is not.
This paper http://math.nju.edu.cn/~zwsun/111o.pdf claims a proof about numbers which cannot be written as the sum of a square and two [not necessarily equal] triangular numbers — I will try to adapt their proof if I can't find another.
Any references or hints on how to approach the problem would be appreciated.
Thanks!
Kieren.

In fact every odd square can be written as $n^2= 4T_{k} + a^2 + (a+1)^2$. Every odd square can be decomposed into:
$n^2 = [(n-1)/2 + (n+1)/2]^2$ with $(n-1)/2=4T_{k}$ and $(n+1)/2 = a^2 + (a+1)^2$ or equivalently $n^2 = (a+b)^2 = a^2 +2ab +b^2$.
Your example $9= 2^2 +5$ can in fact be rewritten as:
$9=(9-1)/2 + (9+1)/2 = 4 + 5 = (1+2)^2 = 4T_{1} + 1^2 + 2^2$
If you lump the two squares $(a^2 +b^2)=m$, then you will end up with:
$n^2= m + 4T_{k}$. This is truly a general result. But lumping the two squares into an integer doesn't make the two squares disappear. They are just hidden.
Let's consider another example $n^2=9^2=(4+5)^2= 4^2 +2*4*5 + 5^2$. We can also rewrite$n^2=9^2=81= 2*4*5 +41$ which really doesn't change the fact that $41=4^2 + 5^2$.
One can convince oneself by decomposing any odd square as done above and look at the final result. $81=9^2= 16 + 2*20 +25$. $20$ is already twice the triangular number $T_{4}=10$. So $81$ is a square that definitely can be written as the sum of 4 times a triangular number and two consecutive squares. One needs only look at the multiplication table to see that $4^2+2*4*5+5^2 = 16 +20 + 20 +25$ add up to $81$.
The diagonals under and above the main diagonal that gives the squares give $2T_{k}$ but since we are adding $2T_{k} +2T_{k}$, we can claim that the odd square we considered is not the sum of a square and twice a triangular number.
So we can write $n^2=9^2=81$ as:
$81= 4^2 + 2*20 + 5^2$ or
$81= 41 + 4*10$
Even squares cannot be decomposed as done above.
