Jully wants to draw a large square formed by a square with a side length of 3, some squares with a side length of 2, and the smallest possible number of squares with a side length of 1. Show, on the grid next to it, how Janaina can make this drawing.
Solution: If Jully wants to use a square with a side length of 3 and squares with a side length of 2 to form the large square, then it must have a side length of at least 5. A square with a side length of 5 corresponds to 25 unit squares. If there is a square with a side length of 3 in its composition, there are 25 - 9 = 16 unit squares remaining. Each square with a side length of 2 corresponds to 4 unit squares. In principle, she could use four squares with a side length of 2, but this configuration is not possible, as can be seen by testing all possible fits. However, it is possible to use three squares with a side length of 2, and then complete with four unit squares, which is the minimum number sought. Next to it, we see two different types of figures that Jully can draw. She can rotate these figures, just like in jthe previous item, to create other drawings.
Question: This solution does not guarantee that there is no, for example, a very large square (consisting of hundreds or thousands of unit squares) formed by 1 square with a side length of 3, hundreds of squares with a side length of 2, and 1, 2, or 3 unit squares.
I thought about it like this: if k is the side length of the square, there are a squares with a side length of 2 and b squares with a side length of 1.
$$9 + 4a + b = k^2$$.
Moreover, for example, even though (a, b, k) may have an algebraic solution (6, 3, 6), it is easy to see that there is no geometric solution for this triplet. How can we ensure that an algebraic solution is constructible?


Nice problem! So, you've shown in your solution that it's possible to create a large square using exactly four unit squares. The question now is can we improve on that.
As you say, the most obvious start point is to look at the total areas of the squares. Using your notation, if we want to make a large square with side $k$ using one $3\times 3$, $a$ $2\times 2$ and $b$ unit squares, we have $$9+4a+b=k^2$$
All square numbers are of the form $4n$ or $4n+1$. This immediately eliminates the possibilities $b=1$ and $b=2$.
Now, can we find a solution with $b=3$? We'd have
$$12+4a=k^2$$
so that $k$ would be even. Consider the rows of the large square that contain the $3\times 3$ square. Each one of these rows has an even length, and so would need to contain an odd number of unit squares. So these three rows have at least three unit squares - but that leaves none available for the columns that contain the $3\times 3$ square; contradiction.
Finally, can $b=0$? In this case,
$$9+4a=k^2$$
so $k$ is odd. This time, note that we certainly must have some rows that don't contain any part of the $3 \times 3$ square. But then all the squares in these rows are $2 \times 2$s, so we reach a contradiction again.
We've thus ruled out all possibilities that $b<4$ so the configuration you found is indeed optimal.