Question: Arrange the digits 1,2,3,4,5,6,7,8,9,0 to make a ten-digit Number that satisfies all of the divisibility rules for 2,3,4,5,6,8,9,10,&11. BONUS: make the number also divisible by 7
Alright. First of all,
3 and 9 are automatically okay. The sum of the digits from 0 to 9 is 45, which is divisible by 3 and 9, so any number made out of these ten will be divisible by 3 and 9.
the last digit MUST be 0, to satisfy 2 and 5 and 10. This also satisfies 6 as well, because it's now divisible by 2 and 3.
Now, let's look at the second-last and third-last digits.
The second-last digit must be divisible by 4, because the number must be divisible by 4 and 8. The third to last digit must also be even, to make it divisible by 8.
all we have is 11 (and 7 for extra credit). To satisfy this, we have to make it so that when placing alternating signs between the digits so the result is a multiple of 11. After a bit of trial and error, I came up with 4123975680, which works for everything. It's not divisible by 7, though. I'll keep looking.
As Martin Schulz pointed out in the comments (now deleted),
9165784320 is divisible by 7
This is a good problem to attack by computer:
It turns out that there are 7344 solutions, including 1056 to the bonus.
So I thought, how far can we go?
And it just happens that 2438195760, 3785942160, 4753869120 and 4876391520 are exactly those permutations of
0123456789divisible by each of 1 through 18, and none of them are divisible by 19.
Code used (Python 3 IDLE):
>>> import itertools >>> normal= >>> bonus= >>> extra= >>> for i in itertools.permutations('123456789'): ... n=int(''.join(i+('0',))) ... if 0==n%8==n%9==n%11: ... normal.append(n) ... if 0==n%7: ... bonus.append(n) ... if 0==n%13==n%16==n%17: ... extra.append(n) ... >>> len(normal) 7344 >>> len(bonus) 1056 >>> extra [2438195760, 3785942160, 4753869120, 4876391520] >>> [i%19 for i in extra] [12, 13, 17, 5]