a) Consider a prime $p$ that divides $10^{n}+1$ for some positive integer $n$. For example, $p=7$ divides $10^{3}+1$. By analyzing the principal period of the decimal representation of $\frac{1}{p}$, verify that the number of times the digit $i$ appears is equal to the number of times the digit $9-i$ appears for each $i \in\{0,1,2, \ldots, 9\}$.

b) Consider a prime number $p$ that does not divide 10 and suppose that the period of the decimal representation of $\frac{1}{p}$ is $2 k$. Is it always possible to break the period into two numbers that sum to $10^{k}-1$? For example, the period of $\frac{1}{7}$ has length $6=2 k$, as it is equal to 142857. Notice that $142+857=999=10^{3}-1=10^{k}-1$.

c) Given

$$
x=\frac{1}{1998}+\frac{1}{19998}+\frac{1}{199998}+\ldots
$$

when writing $2 x$ as a decimal number, what will be the $59^{\text{th}}$ digit after the decimal point?
Solution

a) We can write $10^{n}+1=p \cdot a$ where $a$ is a number with no more than $n$ digits in base 10, say $a=a_{1} a_{2} \ldots a_{n}$. We mean by this that each number $a_{i}$ is one of the digits of $a$. Even if it has strictly fewer than $n$ digits, we can place some $a_{i}$'s on the left as being 0. We have

$$
\begin{aligned}
\frac{1}{p} & =\frac{a}{a \cdot p} \\
& =\frac{a}{10^{n}+1} \\
& =\frac{a\left(10^{n}-1\right)}{10^{2 n}-1} \\
& =\frac{\left[10^{n}(a-1)+\left(10^{n}-1\right)-(a-1)\right]}{10^{2 n}-1}
\end{aligned}
$$

The number $10^{n}-1$ consists of $n$ numbers all equal to 9 and the difference $\left(10^{n}-1\right)-(a-1)$ reduces each of these 9 digits by a digit of $a$. Thus, the decimal representation of the numerator is:

$$
a_{1} a_{2} \ldots a_{n-1}\left(a_{n}-1\right)\left(9-a_{1}\right)\left(9-a_{2}\right) \ldots\left(9-a_{n-1}\right)\left(10-a_{n}\right)
$$

The previous number represents the period of the decimal representation of $\frac{1}{p}$ and each digit $i$ can be paired with another digit of the form $9-i$. Thus, the quantities of appearances of such digits are equal. In the example from the statement, the period of 1/7 is 142857 and we have the following pairings:

$$
\begin{aligned}
& 1 \rightarrow 8 \\
& 4 \rightarrow 5 \\
& 2 \rightarrow 7
\end{aligned}
$$

b) Since $10^{2 k}-1=\left(10^{k}-1\right)\left(10^{k}+1\right)$ and $p$ is prime, one of $10^{k}-1$ and $10^{k}+1$ is a multiple of $p$. We cannot have $10^{k}-1$ as a multiple of $p$, because otherwise we could write $\frac{1}{p}=$ $\frac{\left(10^{k}-1\right) / p}{10^{k}-1}$ and obtain a periodic decimal with a period smaller than $2 k$. Therefore, $p$ divides $10^{k}+1$ and we can repeat the solution from the previous item to conclude that the period of the decimal representation of $1 / p$ is of the form:

$$
a_{1} a_{2} \ldots a_{k-1}\left(a_{k}-1\right)\left(9-a_{1}\right)\left(9-a_{2}\right) \ldots\left(9-a_{k-1}\right)\left(10-a_{k}\right)
$$

By adding the number formed by the first $k$ digits to the number formed by the last $k$ digits, we get $\underbrace{99 \ldots 9}_{k \text { times }}=10^{k}-1$.

c) Notice that

$$
\begin{aligned}
2 x & =\frac{1}{999}+\frac{1}{9999}+\frac{1}{99999}+\ldots \\
& =0, \overline{001}+0, \overline{0001}+0, \overline{00001}+\ldots
\end{aligned}
$$

In the first term, the 1 appears in multiples of three, in the second, in multiples of four, in the third, in multiples of five, and so on. When we add the first two decimals $0, \overline{001}$ and $0, \overline{0001}$, we get the periodic decimal

$$
0,001101011002 \ldots
$$

In positions that are multiples of only one of the numbers in the set $\{3,4\}$, we will have the number 1. In those that are simultaneously multiples of 3 and 4, we will have 2, and in the others, the number 0. In addition, the representation will be periodic with a period of length 12. To find the digits in a given position in the sum, we need to study how many divisors greater than 2 the position has. Among the natural numbers less than 60, none have more than 8 positive integer divisors greater than 2. Thus, in the sum of decimals:

$$
0, \overline{001}+0, \overline{0001}+0, \overline{00001}+\ldots+\overline{0,00 \ldots 01}
$$

there will be no "carry over" in the first 59 places and the digit in the 59th position will be 1, as 59 has only one divisor greater than 2. The other positions will have numbers less than or equal to 8, as 48 is the natural number less than 60 that has the most positive divisors and only 8 of them are greater than 2. Since 60 has 10 positive divisors greater than 2, namely, $3,4,5,6,10,12,15,20,30$ and 60, the "carry over" will occur when we add this decimal to the previous ones and thus the 59th place will have an increment of one unit and will become 2. It remains to verify the contribution of the other decimals in positions of order greater than 60, taking into account the "carry over" in the addition algorithm. The other places of these decimals and the remaining ones that have not yet been accounted for can contribute through the "carry over" in the sum algorithm with an estimated number of

$$
\begin{aligned}
& \frac{60}{10^{61}}+0, \underbrace{\overline{00 \ldots 01}}_{61 \text { digits }}+0, \underbrace{\overline{00 \ldots 01}}_{62 \text { digits }}+\ldots< \\
& \frac{60}{10^{61}}+\frac{1}{9 \cdot 10^{60}}+\frac{1}{9 \cdot 10^{61}}+\ldots= \\
& \frac{60}{10^{61}}+\frac{1}{81 \cdot 10^{59}}< \\
& \frac{1}{10^{59}}
\end{aligned}
$$

Therefore, we will not need to account for other contributions in the 59th position after the decimal point and its digit in the sum is 2.

[^0]:    ${ }^{2}$ There are tournaments with the "Bilbao Scoring" or "Sofia Rule", which, among other conditions, set a win to be worth 3 points, a draw to be worth 1 point, and a loss to be worth zero points.

    ${ }^{3}$ As each game, regardless of the outcome, adds 1 to the total points of the tournament (in a win by the player with the white pieces, he will gain one point and vice versa, and in a draw, both gain half a point).

    ${ }^{4}$ If he wins all the games he plays.