We’ve seen a generalization of the problem to multiplicative factors other than 2 and bases other than 10. A third generalization would be to shift more than one digit.
Take a positive integer in base and move its last digits to the front. What is the smallest such that when you do this, the result is exactly times (where is in the range )?
Let , where . So the digits of are the final digits of and the initial digits of , and the digits of are the remaining digits of both. Let be the number of digits in . Then we require
Now let and let , . Then
and since and are relatively prime, we must have
So we must calculate and then, for each possible value of , obtain and look for the least that satisfies the above relation. (The minimal value of is in fact not but , since there can be no carry to an additional digit when is multiplied by .) Then we can compute , and verify that it does indeed have digits. The smallest such and associated solve the problem.
If is prime, then for all possible and the smallest results when . But if has a common factor with some , then is some factor of . Generally , the number of digits in , is on the order of , so when is prime the solution tends to be many orders of magnitude larger than when it is not.
For instance, consider and . For , . In that case some values of have a common factor with . E.g., gives
The solution is , leading to
But for , is prime. The number of digits in then turns out to be 27, and
And for , is prime too. We end up with the 1499 digit solution
If you’d asked me to guess, before I worked any of this out, the order of magnitude of the smallest positive integer which is exactly tripled when you move the last three digits to the front, I’m pretty sure I would have seriously underestimated it.