# Which natural numbers are a square minus a sum of two squares?

Question: Which natural numbers are of the form $a^2 - b^2 - c^2$ with $a>b+c$?

This question came up in (Eike Hertel, Christian Richter, Tiling Convex Polygons with Congruent Equilateral Triangles, Discrete Comput Geom (2014) 51:753–759), where it was shown that numbers of this form are numbers of equilateral triangles (of the same size) that can tile a convex pentagon.

It was shown (and this is elementary), that any number not of this form must be an idoneal number and thus be among

$$1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 22, 24, 25, 28, 30, 33, 37, 40, 42, 45, 48, 57, 58, 60, 70, 72, 78, 85, 88, 93, 102, 105, 112, 120, 130, 133, 165, 168, 177, 190, 210, 232, 240, 253, 273, 280, 312, 330, 345, 357, 385, 408, 462, 520, 760, 840, 1320, 1365, 1848$$

or equal to one of at most two more unknown numbers (which are at least $\geq 2.5 \cdot 10^{10}$). Interestingly, some of these known idoneal numbers can be written as in the question, for example $7=3^2-1^2-1^2$, but most of them can't.

It is known that if the Generalized Riemann Hypothesis holds, then the list above (without the two unknown numbers) is a complete list of idoneal numbers. Then one can easily check which ones can be of the form as in the question. Hence, assuming the conjecture, the question can be answered. Anyhow, my hope was that maybe the question is more elementary to answer.

Question: Can one answer the above question without using the Generalized Riemann Hypothesis?

• Do you allow $b$ or $c$ to be zero? – Lucia Dec 5 '14 at 18:34
• No, $b$ and $c$ will be side-length of the pentagon. – Andreas Thom Dec 5 '14 at 18:38
• For $a\le 100$, the intersection of the representable numbers and the idoneal numbers is $\{7, 15, 28, 60, 112, 240\}$. Interesting, as it is the same intersection for $a\le 40$. – Robert Bryant Dec 5 '14 at 19:08
• These are all idoneal numbers among the known ones that admit a representations. – Andreas Thom Dec 5 '14 at 19:34
• If $n>3$ is $3\pmod 4$ then it is easy to check that there is a representation of the desired form (indeed with $c=1$). So these numbers (and squares times these numbers) must be excluded from the idoneal list. For other integers, the problem seems pretty much equivalent to the one class per genus"/idoneal numbers problem. – Lucia Dec 5 '14 at 19:45

The numbers that are not of the form $a^2-b^2-c^2$ with $b$ and $c$ positive and $a>b+c$ are precisely the idoneal numbers apart from $7$, $28$, $112$, $15$, $60$, and $240$. As noted in the problem, the paper by Hertel and Richter shows that the numbers not of this form are necessarily idoneal numbers, and a quick calculation shows that $7$, $28$, $112$, $15$, $60$ and $240$ are represented. I now show that if $n$ is of the form $a^2-b^2-c^2$, and $n$ is not of the form $7$ or $15$ times a square, then $n$ is not an idoneal number. The only idoneal numbers that are of the form $7$ or $15$ times a square are the six exceptional numbers listed above, (see Theorem 12 of Kani's article linked below) so the proof is complete.
It may be helpful to recall that $n$ is an idoneal number if and only if, for every reduced quadratic form $Ax^2+Bxy+Cy^2$ of discriminant $-4n$, we have either $B=0$ or $A=B$ or $A=C$. We call here such forms as being of idoneal type. For a good survey on idoneal numbers see Kani.
Suppose $n=a^2-b^2-c^2$ with $b$ and $c$ positive, and $a>b+c$. Then $$-4n = (2c)^2- 4 (a-b)(a+b),$$ and if $a-b>2c$, then the quadratic form $(a-b)x^2 + (2c)xy + (a+b)y^2$ is a reduced form of discriminant $-4n$ not of idoneal type, and so $n$ is not idoneal. Now suppose $a-b<2c$. Here we use $$-4n=(2a-2b-2c)^2 -4 (a-b)(2a-2c),$$ and note that either $(a-b)x^2 + (2a-2b-2c)xy + (2a-2c)y^2$, or $(2a-2c)x^2 +(2a-2b-2c)xy+ (a-b)y^2$ is a reduced form, and it is not of idoneal type unless $a+b=2c$.
Thus $n$ is not idoneal unless $a-b=2c$ or $a+b=2c$. Reversing the roles of $b$ and $c$ we must also have either $a-c=2b$ or $a+c=2b$. These equations are solvable only if $b=c$ and $a=3c$ (so that $n=7b^2$) or $a=5b$ and $c=3b$ (or $a=5c$ and $b=3c$) which leads to numbers $n$ of the form $15b^2$.