Numer Pad Snake

100 Views Asked by At

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.

Image of number pad

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

2

There are 2 best solutions below

1
On

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

Image of number pad

${\large 521478963 ÷ 5 = 104295792.6} $

The quotient is not an integer.

6
On

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.