Let the original number be 10x + y, where y is a single digit positive integer, and x is any positive integer.
We have 2 * (10x + y) = x + 10^m * y, and [log x] = m-1. We use [x] to denote the largest integer that is less than or equal to x.www.ddhw.com
Collect the terms, we have 19 * x = (10^m – 2) * y. Since y is only single digit, 10^m -2 has to be divisible by 19.
Let 10^m – 2 = 19 * k. The left hand side is divisible by 2, so k is divisible by 2. www.ddhw.com
Let k = 2n. Now we have 5 * 10^(m-1) – 1 = 19 * n.
Our task is now to find 499….9 such that it's divisible by 19.
This may take a long slip of paper but it is not hard.www.ddhw.com
Next we will find 99…9 such that it's divisible by 19. This can be simplified as finding 11…1 such that it's divisible by 19. Another long slip of paper will do it.
You can append any multiples of chunks of 9's you found to the 499…9 you found initially.