How to write 2104 as the sum of four squares.
I know the general equation for factoring a number into the sum of four squares but I don't know how to go about this when some of the prime factors are large, for example, one of 2104's prime factors is 263 and I can't figure out how to write 263 as the sum of four squares.
very easy by computer, and the way to go if you need all such representations. By hand, the first thing is that the $w^2 + x^2 + y^2 + z^2$ can be divisible by $4$ with all entries odd, as $1+1+1+1=4$ for example, but if divisible by $8$ all entries must be even. So, we are going to write $2104 / 4 = 526$ as the sum of four squares and double those entries.
Next, $23^2 = 529$ is too big. $22^2 = 484$ is small enough, and $526-484 = 42$ is the sum of three squares $42 = 25 + 16 + 1.$ So, $$526 = 22^2 + 5^2 + 4^2 + 1^2, $$ $$2104 = 44^2 + 10^2 + 8^2 + 2^2. $$