Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With $p$ a prime integer, I am interested in showing the existence of four non-negative integers $\alpha_0,\alpha_1,\alpha_2,\alpha_3$, not all zero, such that $$\alpha_0^2+\alpha_1^2+\alpha_2^2+\alpha_3^2\equiv 0\mod p.$$ I am, of course, aware of the Lagrange four square theorem of which this is a special case. However, the fact that I am concerned with only prime $p$, and also that I have the looser modulo condition, leads me to hope that there is a simpler, more direct way of proving this.

My thoughts so far have been directed towards trying to tie quadratic residues into some sort of pigeonhole principle argument. That hasn't panned out. This question is motivated by a (double-star) problem in Herstein's Topics in Algebra. Ideally I am looking for hints rather than anything fleshed out. Thanks in advance.

share|cite|improve this question
Just a quick idea: If $p \equiv 1 \pmod{4}$, let $i$ be the element such that $i^2 \equiv - 1\pmod{p}$. Then, you can take $\alpha_0 = \alpha_1 = 1$ and $\alpha_2 = \alpha_3 = i$. – JavaMan Nov 21 '12 at 5:31
up vote 2 down vote accepted

Hardy and Wright derive this from their Theorem 87, page 70 in fifth edition:

If $p$ is an odd prime, then there are numbers $x,y$ such that $$ 1 + x^2 + y^2 = m p, $$ where $0 < m < p.$

Note that Theorem 86 on the same page says you may take $y = 0$ if $p = 4k+1.$

I would characterize the proof, roughly, as counting the squares $\pmod p,$ but care is needed.

share|cite|improve this answer
Thanks for the reference, it was exactly what I needed. In fact the method of Hardy and Wright's proof of Thm 87 is exactly what I was trying -- guess I should have tried harder! – Jonathan Nov 21 '12 at 5:53
@Jonathan, fair enough. I was unable to find the double star exercise in Herstein. Plus, for what it's worth, both he and H+W eventually switch to the Hurwitz quaternions to reduce the needed special cases in the four square theorem. – Will Jagy Nov 21 '12 at 6:23
Sorry, my first iteration of that comment was worded really clumsily. Your post pointed me in exactly the right direction. The problem in Topics in Algebra is 3.4.13b in my edition, showing quaternions over $\mathbb{Z}/p\mathbb{Z}$ are not a division ring. – Jonathan Nov 21 '12 at 6:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.