How many ways can an integer be written as a sum of three integer squares

151 Views Asked by At

I'm working on a fairly simple Physics problem (particle in an infinite potential cube), and I'm asked:

"Are any of the energy eigenvalues degenerate? If so, what is the degeneracy?".

The expression for the energy (ignoring a constant multiplier) comes to the form

$E = a^2 + b^2 + c^2$

Where a,b,c are all integers.

Degeneracy occurs when some arrangement of these values gives the same energy value as some different arrangement. (So any state without a = b = c will have at least triple degeneracy via permutations).

Is there some closed-form solution or sequence for how many ways an integer can be written as a sum of three integer squares?