Show how to pack squares of size 1×1, 2×2, ..., 16×16 into a 39×39 square.

More generally, investigate the smallest square with integer-length sides that squares of size 1×1, 2×2, ..., n×n can be packed into.