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.

$n^2$ can be written as $a^2 + b^2 + b,$ with $a,b \geq 1,$ if and only if
$$  4 n^2 + 1   $$ is composite.
If $4 n^2 + 1$ is composite, it is the sum of two squares in a distinct manner,
$$  4 n^2 + 1 = 4 u^2 + (2v+1)^2. $$ Then
$$ n^2 = u^2 + v^2 + v.  $$
If $$ n^2 = a^2 + b^2 + b,$$ then
$$  4 n^2 + 1 = 4 a^2 + (2b+1)^2,  $$ has two distinct representations as the sum of two squares and hence is composite.
There is a very nice short article by John Brillhart about the relationship between multiple expressions of a number as the sum of two squares (or as any $m x^2 + n y^2$) and compositeness of that number. American Mathematical Monthly, December 2009, pages 928-931, title A Note on Euler's Factoring Problem. The first page of a follow-up article is visible at FIRST PAGE.
