Rectangles and Prime Numbers

To test whether a number n is prime, one can try to construct a rectangle of area n, and of width strictly more than two and strictly less than n (this rectangle is shown in red). If there are any leftover squares (shown in green), then this rectangle doesn't count and you need to try another width. If no such width exists, then the number is prime.