<s>[INST] square that can be written as mean of as many pairs of squares as possible If $b^2=\displaystyle\frac{a_1^2+c_1^2}2$ and $b^2=\displaystyle\frac{a_2^2+c_2^2}2$... and $b^2=\displaystyle\frac{a_n^2+c_n^2}2$, what is the largest possible value of $n$, or can $n$ be arbitrarily large?
e.g for $n=7$, $$325^2=\frac{49^2+457^2}2=\frac{65^2+455^2}2=\frac{115^2+445^2}2=\frac{175^2+425^2}2$$
$$=\frac{221^2+403^2}2=\frac{235^2+395^2}2=\frac{287^2+359^2}2,$$
and
$$425^2=\frac{7^2+601^2}2=\frac{85^2+595^2}2=\frac{175^2+575^2}2=\frac{205^2+565^2}2$$
$$=\frac{289^2+527^2}2=\frac{329^2+503^2}2=\frac{355^2+485^2}2.$$
 [/INST] From a beautiful theorem of Jacobi, the number of ways of writing an integer as a sum of two squares is equal to four times its number of divisors of the form $4n+1$ minus four times its number of divisors of the form $4n+3$. You can find an elementary proof of this result in Hardy & Wright, or at the end of my answer to this question if you are familiar with the basics of $L$-functions.
Hence if we choose $b$ to be, say, only divisible by primes of the form $4n+1$ then we can find arbitrarily many solutions to $2b^2=a^2+b^2$ with a fixed value of $b$.
Note: It can be easily shown that every solution of $a^2+c^2=2b^2$ in integers can be written as
$$(n^2-2mn-m^2)^2+(n^2+2mn-m^2)^2 = 2(m^2+n^2)^2$$
where $m,n$ are any integers. In particular, $b$ is itself always a sum of two squares, and we see that the number of solutions of $a^2+c^2=2b^2$ for a fixed value of $b$ is at most equal to the number of ways of writing $b$ as a sum of two squares.
</s>