Use combinations?

0000 0001 0002 0003 0004

0014 0010 0011 0012 0013

0023 0024 0020 0021 0022

0032 0033 0034 0030 0031

....

0104 0100 0101 0102 0103

etc ...

do you see what's going on? I set it up so that each column has the same remainder ... I guess you could use set congruences.

. I'm not too sure how to prove this formally, but it's pretty obvious .... like if , then the set becomes {3,4,5,6,7} = {3,4,0,1,2} (mod 5).

So, if you let a be the sum of the first 3 numbers (from the first 3 columns), then you're left with a, a+1, a+2, a+3, a+4. This is true for all a, and you'll see that the remainder of 5 happens only once in each case. Also, there's a possible 5^3 = 125 combinations for the summation of the first 3 columns ... so each remainder occurs 125 times ....

This is really messy, but I hope it helps get you started