Let a and b be positive integers. We tile a rectangle with dimensions a and b using squares whose side-length is a power of 2, i.e. the tiling may include squares of dimensions 1×1,2×2,4×4 etc. Denote by M the minimal number of squares in such a tiling. Numbers a and b can be uniquely represented as the sum of distinct powers of 2: a=2a1+⋯+2ak,b=2b1+⋯+2bℓ. Show that M=i=1∑kj=1∑ℓ2∣ai−bj∣. Tilingcombinatoricscounting