By the way, all permutations of the digits 1 through 7 form a base 8 number that is divisible by 7. This is directly analogous to the way that any permutation of the digits 1 through 9 (or 0 through 9) form a base 10 number that is divisible by 9.