Let be a positive integer. When is expressed as a decimal, it is a recurring decimal with smallest period . Find the sum of all possible values of . (Note: We say that is a period of a recurring decimal if starting from some place the digits of the decimal repeat every digits. For instance, has smallest period 3 while has smallest period 6.)
Solution
The answer is .
We first prove the following result.
Claim. Consider a positive rational number where . The smallest period of this number when expressed as a decimal number is the order of modulo .
Proof. Note that has period if and only if the tail part of is the same as that of . This holds if and only if is a terminating decimal, i.e. for some nonnegative integer . Equivalently, this means
As , this is the same as . By definition, the smallest positive integer for which this holds is the order of modulo .
Now, when runs through all positive integers, the denominator of in the lowest term can be any positive divisor of . Let be the order of modulo . By the claim, it suffices to find for each positive divisor of .
* Since , we have .
* Since and , we have .
* Since and
by the binomial theorem, we have .
* Since and , we have .
* For where , we have . Therefore, we easily deduce , .
It follows that the answer is .