I recently happened to notice that if
(a^2) + (b^2) = 2p,where a, b, and p are all integers, then
((a+b)/2)^2 + ((a-b)/2)^2 = p.
For example, if we know that
5^2 + 1^2 = 26 = 2*13,
it follows that
((5+1)/2)^ + (5-1)/2)^2 = 13,
that is,
3^2 + 2^2 = 13.
Suppose, though, that
(a^2) + (b^2) = 3p
or, more generally,
(a^2) + (b^2) = op,
where o is an odd integer.
Is there some way of deriving from this a formula such that
(c^2) + (d^2) = p,
where c and d are also integers, with values determined by a and b?