# Alphametic with modulo

Solve this alphametic

$ABCDEFG$ $mod$ $(A×B×C×D×E×F×G) = 0$

example :

$ABCDE$ $mod$ $(A×B×C×D×E) = 0$
$13248$ $mod$ $(1×3×2×4×8) = 0$

Note :

• Do not replace any letter with 0.
• Each letter represent different digit.
• There is only one solution.

A simple computer search quickly yields

1687392.

Is a computerless solution required?

Let's see what we can do. So we have seven digits chosen from 123456789. We must include at least one of {3,6,9} so the number is going to have to be a multiple of 3. We must include at least two of {2,4,6,8} so it has to be a multiple of 12.

If one of our digits is 5 then the number is a multiple of 10 and therefore ends in 0, which isn't allowed. So we are actually choosing seven digits from 12346789. Now we have only four odd digits so we must have three from {2,4,6,8}.

More specifically, either we take all of {1,3,7,9} and three of {2,4,6,8}, in which case we get a multiple of 9072 or of 12096, depending on whether we use the 6 or not; or else we take all of {2,4,6,8}, in which case we get a multiple of 8064 or 10368, depending on whether we use the 7 or not.

We can rule out some of these. If we take all of 1379 and three of 2468, the possible digit-sums mod 9 are 5 (from 246), 7 (from 248), 0 (from 268), 2 (from 468). Since one of the digits is 9, we must pick the third of these. So if we use all of 1379 then in fact our digit-set is 1236789.

On the other hand, if we take all of 2468 and three of 1379 then again we necessarily get a multiple of 9 (from 6 and either 3 or 9); the possible digit-sums mod 9 are 4 (from 137), 6 (from 139), 1 (from 179), 3 (from 379) -- none of these can be a multiple of 9.

So our digit-set must be 1236789 and our number must be a multiple of 18144. There are about 500 multiples in range, which is still rather a lot to do computerless.

• I use my computer to create this. If anyone can explain how to answer without computer I will upvote. – Jamal Senjaya Sep 29 '16 at 8:45
• If I ask to replace the letter with a combination of (1,2,3,6,7,8,9), this will be a no-computer puzzle. – Jamal Senjaya Sep 29 '16 at 8:51

If we pick seven distinct elements out of the nonzero digits 1-9, at least two of them must be even, and at least one of them must be divisible by 3, so our number must be divisible by 6.

If our even number would be divisible by 5, then the last digit would be zero, which is not possible, so the number doesn't contain a 5.

Now, if we pick seven distinct elements out of the digits {1, 2, 3, 4, 6, 7, 8, 9}, at least one of them must be divisible by 4, and so our number is also divisible by 4 and by LCM(4,6) = 12.

So we are left to search among seven-digit numbers which are multiples of 12 and do not contain 0 or 5 in their decimal representation.

• You can go even further. If you pick those seven distinct digits and multiply them, the number will always be a multiple of 144 (You pick three out of 2, 4, 6, 8 which always gives a multiple of 16 and two out of 3, 6, 9 which always gives a multiple of 9). – w l Sep 29 '16 at 11:34
• @wl 24 is divisible by 2, 4, 6 and 8, yet not a multiple of 16. And picking three out of 3,6 and 9 does not guarantee you end up with a multiple of 9. – Lynn Sep 29 '16 at 11:53
• The product will be a multiple of the numbers. Any product of three numbers from 2, 4, 6, 8 will be a multiple of 16 (= GCD(2*4*6, 2*4*8. 2*6*8, 4*6*8)). – w l Sep 29 '16 at 12:00