Starting from the outer square, the subsequent square should have
A/ x and y coordinates of the outer square plus 20
B/ the size of the outer square minus 40
From that you just have to make it so that as the loop count goes up (or down), the subsequent square's coordination and size change.