# Sum of eight squares over a finite field.

Consider the split-octonions $\mathbb{O}$ with coefficients in $\mathbb{F}_q$. Suppose $a \in \mathbb{F}_q$ and $b \in \mathbb{F}_q^*$. I want to find the amount of elements $x \in \mathbb{O}$ such that $\overline{x} x = ac^{-1}$. As far as I understand, this reduces to finding the number of solutions of $$x_0^2 + x_1^2 + ... + x_7^2 = ac^{-1}$$ for each choice of $a$ and $c$ over $\mathbb{F}_q$, but I don't know how to count these. Moreover, I even know that the answer is $q^7-q^3$ (I am reading a paper, where this is stated but never proved), but I cannot understand why. Could you please help?

Here is some kind of an insight: there are $q$ choices for $a$ and $q-1$ choices for $c$. Thus, I need to prove that the given equation has $q^2+q^3+q^4+q^5$ solutions over $\mathbb{F}_q$.

UPD: The paper I am talking about is http://arxiv.org/abs/1310.5886. Basically, I am dealing with the proof of Theorem $1$ on page $10$.

• @WillJagy Alright, added the link to the paper. – kissanpentu Dec 2 '15 at 18:54
• This seems interesting books.google.com/… – Will Jagy Dec 2 '15 at 19:37
• See this thread, in particular Gerry Myerson's answer, for more information about the argument Will Jagy refers to. Basically the point is to calculate the number of solutions in 3 cases A) $ac^{-1}=0$, B) $ac^{-1}$ is a square, C) $ac^{-1}$ is a non-square. It turns out that the tallies in cases B and C are equal. Thus it suffices to consider the case $A$ because there are $q^8$ combos of $x_i$:s altogether. – Jyrki Lahtonen Dec 2 '15 at 21:41
• @JyrkiLahtonen, it occurred to me that the octonion multiplication tells us that the count of representations for any nonzero fixed element stays the same, we do not really need to worry about quadratic residues in dimension 8. – Will Jagy Dec 3 '15 at 1:46
• @Jyrki, I was also surprised to read of a method for doing this by stereographic projection around one solution. The main trouble is that the number of ways to represent $0$ is large and itself requires a calculation; this does not occur with integer or rational solutions. – Will Jagy Dec 3 '15 at 2:07

Live and learn. In Ireland and Rosen, A Classical Introduction to Modern Number Theory (Second edition), on page 102 we find Proposition 8.6.1. Evidently $p$ is an odd prime and we are in the field $\mathbb Z / p \mathbb Z.$ If $r$ is even, the number of solutions of $$x_1^2 + \cdots + x_r^2 = 1$$ is $$p^{r-1} - (-1)^{(r/2)((p-1)/2)} p^{(r/2)-1},$$ so there is your $p^7 - p^3$ for one important case.
I see no difference if the number represented is a quadratic residue $\pmod p$ rather than $1.$ Not entirely sure how many representations of $0$ there are, so there is more work to be done to count representations of non-residues. Good start, though.
Borrowed Arithmetic of Finite Fields by Charles Small. In a finite field $\mathbb F$ with odd number $q$ elements, $q$ a prime power, and $n$ divisible by $4,$ the number of solutions to $$x_1^2 + \cdots x_n^2 = b$$ is $$q^{n-1} - q^{(n-2)/2}$$ for nonzero $b,$ while the number of solutions to $$x_1^2 + \cdots x_n^2 = 0$$ is $$q^{n-1} + q^{n/2} - q^{(n-2)/2}$$ This is Theorem 4.5 on page 91, with necessary definitions on pages 86 and 88.
• Thank you, this really helped! Although there is still a case when $q=2$. – kissanpentu Dec 10 '15 at 12:29