# Alphametic with modulo

Solve this alphametic

π΄π΅πΆπ·πΈπΉπΊ mod (π΄ Γ π΅ Γ πΆ Γ π· Γ πΈ Γ πΉ Γ πΊ) = 0

example :

π΄π΅πΆπ·πΈ mod (π΄ Γ π΅ Γ πΆ Γ π· Γ πΈ) = 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.

But let's see if we can go a bit further. Our number needs to be a multiple of 32Γ81Γ7. To be even it must end with 2,6,8; to be a multiple of 4, with 12,32,72,92, 16,36,76,96, 28,68; to be a multiple of 8, with 312,712,912, 632,832, 672,872, 192,392,792, 216,816, 136,736,936, 176,376,976, 296,896, 128,328,728,928, 168,368,768,968; to be a multiple of 16, with 7312,9312, 3712,9712, 6912,8912, 1632,7632,9632, 6832, 8672, 1872,3872,9872, 6192,8192, 1392,7392, 1792,3792, 3216,7216,9216, 2816, 7136,9136, 2736,8736, 1936,7936, 2176,8176, 1376,9376, 2976,8976, 1296,3296,7296, 2896, 6128, 1328,7328,9328, 1728,3728,9728, 6928, 3168,7168,9168, 2368, 2768, 1968,3968,7968; to be a multiple of 32, with 97312,69312,89312, 63712,83712,39712, 86912,38912,78912, 81632,17632,97632,89632, 16832,76832,96832, 31872,91872,63872,19872,39872, 36192,76192,68192, 71392,67392,87392, 61792,81792,13792, 73216,93216,37216,97216,89216, 27136,87136,79136, 12736,92736,28736, 71936,27936,87936, 82176,38176,98176, 21376,81376,29376,89376, 82976,18976,38976, 31296,71296,83296,87296, 12896,32896,72896, 36128,76128,96128, 71328,91328,67328,19328,79328, 61728,13728,93728,69728, 16928,36928,76928, 23168,27168,39168,79168, 12768,32768,92768, 31968,71968,23968,27968. (At each stage we prepend odd or even digits still available, depending on whether we already have a multiple of the relevant power of 2 or not.) That's "only" 87 numbers, and for each there are just two possibilities (for which way around the other two digits go) to check for divisibility by 81 and by 7. I am doing this strictly computerlessly, and trying 174 numbers is beyond my boredom threshold right now, but it's clearly perfectly doable.

• I use my computer to create this. If anyone can explain how to answer without computer I will upvote. Commented Sep 29, 2016 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. Commented Sep 29, 2016 at 8:51
• Your paragraphs 6,7 are simply a roundabout way of piecewise concluding that the number is a multiple of 9.
– smci
Commented Feb 4, 2021 at 6:23
• @smci I'm not sure I understand. Those paragraphs are a way of concluding that the number is a multiple of 9 and the set of digits is {1,2,3,6,7,8,9}. Commented Feb 4, 2021 at 18:35
• Once you have kicked out 5, you already know that the product is a multiple of 9 (because you will have to retain at least 2 of 3,6,9) and from this you can directly jump into the digit sum argument: It is 4 mod 9 for all 8 terms and the only way to fix that is removing the 4. Commented Feb 4, 2021 at 19:47

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
Commented Sep 29, 2016 at 11:34
• 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
Commented Sep 29, 2016 at 12:00