Problem:
Let be a positive integer whose decimal representation contains as a contiguous substring, and let be a positive integer such that . Find the minimum possible value of
Solution
Solution:
Answer:
Set . Then, in lowest terms, for some integer . On the other hand, the decimal expansion of simply consists of the decimal expansion of , possibly with some padded zeros, repeating. Since contains as a contiguous substring, the decimal representation of must as well.
Conversely, if is relatively prime to and if there exists an such that the decimal representation of contains the substring , we claim that is an attainable value for . To see this, note that since is relatively prime to , there exists a value of such that divides (for example, ). Letting and , it follows that . Since the decimal expansion of this fraction contains the substring , it follows that must also, and therefore is an attainable value.
We are therefore looking for a fraction which contains the substring in its decimal expansion. Since , and are the first five Fibonacci numbers, it makes sense to look at the value of the infinite series
A simple generating function argument shows that , so substituting leads us to the fraction (which indeed begins ).
How do we know no smaller values of are possible? Well, if contains the substring somewhere in its infinitely repeating decimal expansion, then note that there is an such that the decimal expansion of the fractional part of begins with We can therefore, without loss of generality, assume that the decimal representation of begins But since the decimal representation of begins , it follows that
On the other hand, this absolute difference, if non-zero, is at least . If , this is at least , and therefore no smaller values of are possible.