Received answer to the following question from Jishka. (2469)

Would you please explain the steps you used to get the answer 2469. I must show work.

Thank you

Using the 9 digits, 1, 2, 3, 4, 5, 6,7, 8 and 9 you can arrange four different digits to form a four-digit number that is NOT divisible by 7. The digits 1238 cannot be arranged to create a four-digit number that is divisible by 7. The digits 1389 also cannot be arranged to form a four-digit number that is divisible by 7. Find one additional set (not 1238 or 1389) of four different digits that is not divisible by 7. Provide the digits to form the smallest four digit value.

I could think of no easy way to determine the answer. I'd be interested to know what the teacher says as far as finding the solution quickly. I think that questions like this are a waste of time, because there's no real mathematical insight to be gained. It's just a matter of searching for something in a long list.

To that end, I wrote a small perl program that just tried all the 4-digit numbers. That was the only solution found.

Now, if they had wanted divisibility by 3 or 9, then you could use the casting out nines, which says that if the sum of the digits is divisible by 9, so is the number. Even that gives little help in reducing the list.

Unfortunately, casting out sevens requires factoring the number, so it doesn't help much. If any of the factors is divisible, then so is the number. (duh)

So, another way might be to check all numbers that contain only prime factors not including 7: 2,3,5,11,13,... but that's also tedious.

To find a set of four different digits that is not divisible by 7, we need to consider the divisibility rule for 7. The rule states that if the difference between twice the units digit and the remaining digits, excluding the units digit, is divisible by 7, then the number itself is divisible by 7.

Now let's consider the digits 1, 2, 3, 4, 5, 6, 7, 8, and 9.

The set 1238 cannot be arranged to form a four-digit number that is divisible by 7. Let's check why:

- If we arrange the digits 1238 to form the number 1238, the difference between twice the units digit (2 * 8 = 16) and the remaining digits (123) is 16 - 123 = -107, which is not divisible by 7.

We are also given that the set 1389 cannot be arranged to form a four-digit number that is divisible by 7. Let's check why:

- If we arrange the digits 1389 to form the number 1389, the difference between twice the units digit (2 * 9 = 18) and the remaining digits (138) is 18 - 138 = -120, which is not divisible by 7.

So, we need to find one additional set of four different digits that is not divisible by 7. We can exclude the sets mentioned above (1238 and 1389).

To find the smallest four-digit number, we can start by considering the lowest digit, which is 1. Now let's try to find the remaining three digits.

We can start by checking if 1, 2, 3, and 4 form a number divisible by 7:

- If we arrange the digits 1234 to form the number 1234, the difference between twice the units digit (2 * 4 = 8) and the remaining digits (123) is 8 - 123 = -115, which is not divisible by 7.

Next, let's check if 1, 2, 3, and 5 form a number divisible by 7:

- If we arrange the digits 1235 to form the number 1235, the difference between twice the units digit (2 * 5 = 10) and the remaining digits (123) is 10 - 123 = -113, which is not divisible by 7.

Continuing this process, we find that the next set, 1, 2, 3, and 6, does form a number that is divisible by 7.

- If we arrange the digits 1236 to form the number 1236, the difference between twice the units digit (2 * 6 = 12) and the remaining digits (123) is 12 - 123 = -111, which is not divisible by 7.

Finally, we find that the set 1, 2, 3, and 7 forms a number that is not divisible by 7.

- If we arrange the digits 1237 to form the number 1237, the difference between twice the units digit (2 * 7 = 14) and the remaining digits (123) is 14 - 123 = -109, which is not divisible by 7.

Therefore, the smallest four-digit number that can be formed using four different digits from the given set (1, 2, 3, 4, 5, 6, 7, 8, and 9) and is not divisible by 7 is 1237.