<s>[INST] Can any number of squares sum to a square? Suppose 
$$a^2 = \sum_{i=1}^k b_i^2$$ 
where $a, b_i \in \mathbb{Z}$, $a>0, b_i > 0$ (and $b_i$ are not necessarily distinct).
Can any positive integer be the value of $k$?

The reason I am interested in this: in a irreptile tiling where the smallest piece has area $A$, we have $a^2A = \sum_{i=1}^k b_i^2A$, where we have $k$ pieces scaled by $b_i$ to tile the big figure, which is scaled by $a$. I am wondering what constraints there are on the number of pieces.
Here is an example tiling that realizes $4^2 = 3^2 + 7 \cdot 1^2$, so $k = 8$.

 [/INST] Solutions exist for every $k>0$.  The simplest forms use most of the $b_n$ values as $1$.  I will list them as "$b_*$".  I suspect there are infinitely many distinct answers for each $k\ge2$, but I can't prove it.
if $k = 2n$ (k is even) and large enough ($k\ge4$ or $n>1$):


*

*$ a = n $

*$ b_1 = n-1 $

*$ b_* = 1 $
\begin{align}
\sum_{i=1}^k b_i^2 & = (n-1)^2 + (2n-1)\cdot1^1 \\
 & = n^2 - 2n + 1 + 2n - 1 \\
 & = n^2 \\
 & = a^2 \\
\end{align}
if $k = 4n + 1$ and large enough ($k\ge9$ or $n>1$)


*

*$ a = n+1 $

*$ b_1 = n-1 $

*$ b_* = 1 $
\begin{align}
\sum_{i=1}^k b_i^2 & = (n-1)^2 + ((4n+1)-1)\cdot1^1 \\
 & = n^2 - 2n + 1 + 4n \\
 & = n^2 +2n + 1 \\
 &= (n + 1)^2 \\
 & = a^2 \\
\end{align}
if $k = 4n + 3$ 


*

*$ a = 2n+3 $

*$ b_1 = 2n+2 $

*$ b_2 = 2 $

*$ b_* = 1 $
\begin{align}
\sum_{i=1}^k b_i^2 & = (2n+2)^2 + 2^2 + ((4n+3)-2)\cdot1^1 \\
 & = 4n^2 + 8n + 4 + 4 + 4n + 1 \\
 & = 4n^2 + 12n + 9 \\
 &= (2n + 3)^2 \\
 & = a^2 \\
\end{align}
The only values that don't work with these patterns are $k$ = 1, 2, or 5.
For $k=1$, $a=b_1$ for any values.
For $k=2$, we have we have a well known case, with minimal value $5^2=4^2+3^2$
For $k=5$, the minimal value is $4^2=3^2+2^2+1^2+1^2+1^2$
</s>