In reply to Ian Wakeling.

Very nice! For readers who do not immediately see what Ian is doing with binary numbers, see this article about creating a matrix that contains all combinations of zeros and ones.