A general condition for equal sums of squares?



Hi Everybody,

trying to find a general identity for equal sums of squares as in

sum_{i=1}^{n} x_i^2 = sum_{i=1}^{n} y_i^2

i found that for a value x there always is a solution relating
x_1,y_1 and S_n as follows :

x_1=(1+(n mod 2))x-(y_1 mod 2)(n mod 2)

S_n=sum_{i=2}^{n} x_i=((n-2)/(2-(n mod 2)))x+ny_1/2-(n-2)(n mod 2)(y_1
mod 2)/2

Is this a trivial relationship, and are there any references around
this subject?

Thanks

Gerry

.