# Extension of Dickson's theorem on integers of the form $a^2+b^2+2c^2$

Theorems V in this paper of L.E. Dickson states that the following two sets are equal. $$E=\{a^2+b^2+2c^2 \ | \ a,b,c \in \mathbb{Z}\} \ \text{ and } \ F=\mathbb{N} \setminus \{4^k(16n+14) \ | \ k,n \in \mathbb{N}\}.$$ Let $$\mathbb{A}$$ denote $$\mathbb{N}$$ or $$\mathbb{Z}$$. Consider the following set: $$E(\mathbb{A}) = \left\{\frac{1}{2}\|u+v \|^2 \text{ with } u,v \in \mathbb{A}^3 \text{ and } \|u \| = \|v \| \right\}.$$

Let $$u= (a,b,c)$$, $$v = (b,-a,c) \in \mathbb{Z}^3$$. Then $$\|u \| = \|v \|$$ and $$\frac{1}{2}\|u+v \|^2 = a^2+b^2+2c^2.$$
It follows that $$F= E \subseteq E(\mathbb{Z})$$. Now, by Legendre's three-square theorem, $$E(\mathbb{Z}) \subset F$$ also.
Then, we have an extension of Dickson's theorem as $$E(\mathbb{Z}) = F$$. Now, what about $$E(\mathbb{N})$$?

Take $$u=v \in \mathbb{N}^3$$, then $$\frac{1}{2}\|u+v \|^2 = 2 \|u \|^2$$, so by Legendre's three-square theorem, $$E(\mathbb{N})$$ contains the even part $$F$$. The computation below shows that $$E(\mathbb{N})$$ contains every odd number less than $$95362$$, except those in $$I=\{ 5, 23, 29, 65, 167 \}$$, suggesting that $$E(\mathbb{N}) = F \setminus I$$.

Question: Is it true that, for $$u,v \in \mathbb{N}^3$$ with $$\|u \| = \|v \|$$, the form $$\frac{1}{2} \|u+v \|^2$$ covers every odd number, except those in $$\{ 5, 23, 29, 65, 167 \}$$?

Application: this answer proves that the form $$\| A\|^2$$ covers every natural number for $$A \in M_3(\mathbb{Z})$$.
A positive answer to the above question would prove this result for $$A \in M_3(\mathbb{N})$$.

For the convenience of the reader, the answer of Philipp Lampe (of what was Question 1 in a previous version) was incorporated in the post.

Computation

sage: L=cover(135)
sage: set([2*i+1 for i in range(47681)])-set(L)
{5, 23, 29, 65, 167}


Code

# %attach SAGE/3by3.spyx

from sage.all import *

cpdef cover(int r):
cdef int a1,a2,a3,b1,b2,b3,x,n
cdef list L
L=[]
for a1 in range(r):
for a2 in range(a1+1):
for a3 in range(a2+1):
x=a1**2+a2**2+a3**2
for b1 in range(isqrt(x)+1):
for b2 in range(isqrt(x-b1**2)+1):
for b3 in range(isqrt(x-b1**2-b2**2)+1):
if a1**2+a2**2+a3**2==b1**2+b2**2+b3**2:
n=((a1+b1)**2+(a2+b2)**2+(a3+b3)**2)/2
if is_odd(n) and not n in L:
L.append(n)
return L

• In this post, $\mathbb{N}$ is the set of non-negative integers. Nov 3 '18 at 14:59

Answer to Question 1. Yes, $$E(\mathbb{Z})=F$$.
The inclusion $$F\subseteq E(\mathbb{Z})$$ follows from $$E\subseteq E(\mathbb{Z})$$ and Dickson's result $$E=F$$. It remains to show $$E(\mathbb{Z})\subseteq F$$. Pick $$n\in E(\mathbb{Z})$$. By definition there exist $$u,v\in\mathbb{Z}^3$$ such that $$\lVert u\rVert=\lVert v\rVert$$ and $$n=\lVert u\rVert^2+\lvert u\cdot v\rvert$$. Then $$2n =\lVert u\rVert^2+ \lVert v \rVert^2+ 2\lvert u\cdot v\rvert = \lVert u+v\rVert^2$$ is a sum of three squares. Legendre's three-square theorem implies that $$2n$$ cannot be written as $$4^a\left(8b+7\right)$$ with $$a,b\geq 0$$. From this we can conclude that $$n$$ must belong to $$F$$.
given your interest: the list of all $$A x^2 + B y^2 + C z^2$$ with ordered positive coefficients, such that the represented numbers can be described by congruences
• Then, what is, for example, $\{ x^2+y^2+z^2+xy+xz+yz \ | \ x,y,z \in \mathbb{N} \}$? Oct 28 '18 at 14:26