This problem is a representation of NOD problem.
Here, NOD = Number of Divisor. NOD Counting with prime is a basic topic in number thoery. If you have no idea about this, google and learn.
So, Basically with n bricks of 1 x 2 dimension. We can only form rectangle with area of 2*n.
Now, it's up to you to solve the rest of them.