On this number pad, a nine-digit number is made by walking through each digit once, starting from a random digit and only moving to adjacent digits.

That number is then divided by its first digit. In this example,

$$\color{orange}987456321 ÷ \color{orange}9 = 109717369.$$

Will this method always result in an integer?

My Solution:

Answer: No. (Without Calculation we can derive the result using divisibility test)

Divisibility test image

The given number pad has digits from 1 to 9. Clearly, it has 5 odd digits and 4 even digits. The next to even digits are odd & next to odd digits are even. The valid moves are odd to even (or) even to odd. If it start with even digit then it is not possible to end with even digit(since number pad has only 4 even digits). So it must start with odd digit, and the generated number will end with odd digit.

The possible start digits are 1, 3, 5, 7, or 9. Suppose, it start with 1, 3 or 9 then the generated number is divisible by 1, 3 or 9 respectively. Since all integers divisible by 1 and sum of digits 1+2+3+…+9 is 45, which is divisible by 3 and 9. The other two possible start digits are 5 or 7. If it start with 5 then the generated number not divisible by 5. Because it is not possible to get the end digit as 0 or 5. Hence the result always not an integer.

Looking forward other solutions

• Assuming you mean orthogonally adjacent when you say "adjacent" that sounds fine. A few grammatical corrections could be made. If "adjacent" includes diagonally adjacent as well, then you could have numbers like 235698741 which further increases the number of counterexamples but to simply prove that there exists at least one scenario where the result of the division is a non-integer is enough. – JMoravitz Jun 1 '18 at 22:59
• Your second image gives a simple way to construct a counterexample. If the intention is to ask for other ways to construct counterexamples, putting a few words about your approach in the body of the Question will help Readers respond. – hardmath Jun 1 '18 at 22:59
• You have linked two pictures of number pads. The first image has digits $0$ through $9$; the second has only $1$ through $9$. Are we to assume that the number must be formed on the second number pad? In that case you don't even need to reason about odd and even numbers, because if you start at $5$ you cannot end at $5,$ and the digit $0$ is never possible, any number starting with $5$ cannot end in $0$ or $5$. And if you do include a $0$ key that can be used in the $9$-digit number, you still only need to trace one number starting at $5$ and avoiding $0$ in order to show a counterexample. – David K Jun 2 '18 at 16:46

You can start with the number $$5$$ in the middle

$${\large 521478963 ÷ 5 = 104295792.6}$$

The quotient is not an integer.

• In fact, due to the fact that all multiples of $5$ have to end in a $5$, any pattern which starts with a $5$ is a counterexample. – Rhys Hughes Jun 1 '18 at 23:37

If you start with $5$ you have an instant counterexample as only numbers which end $5$ are multiples of it.

In addition:$$789632541\div 7\not\in\Bbb Z$$ $$789632145\div 7\not\in\Bbb Z$$ $$741236589\div7\not\in\Bbb Z$$ $$741236985\div7\not\in\Bbb Z$$ $$741258963\div7\not\in\Bbb Z$$ $$745896321\div7\not\in\Bbb Z$$ $$789654123\div7\not\in\Bbb Z$$ In fact, the only one that started with 7 that worked was $785412369$.

Probably many more counterexamples I missed.

• $9$s all seem to work, as do the $3$s – Rhys Hughes Jun 1 '18 at 23:49
• If you use every digit from $1$ through $9$ once, the sum of digits is $45$ and the divisibility test for $9$ implies that the number will always be divisible by $9$ and by $3$; – David K Jun 2 '18 at 16:53
• Of course! Hadn't thought of that, many thanks. – Rhys Hughes Jun 2 '18 at 16:57
• There are only $40$ possible nine-digit numbers that can be constructed from the $9$-digit keypad according to the rules given. You've shown that $15$ of these fail the divisibility test, and the other $25$ pass. Finding out which of the $7$s pass is the part where you have to do some heavier number-crunching. – David K Jun 2 '18 at 16:58
• I found it very interesting that one of the $7$ actually made it through – Rhys Hughes Jun 2 '18 at 16:59