# 2022 AIME I Problems/Problem 13

## Problem

Let $S$ be the set of all rational numbers that can be expressed as a repeating decimal in the form $0.\overline{abcd},$ where at least one of the digits $a,$ $b,$ $c,$ or $d$ is nonzero. Let $N$ be the number of distinct numerators obtained when numbers in $S$ are written as fractions in lowest terms. For example, both $4$ and $410$ are counted among the distinct numerators for numbers in $S$ because $0.\overline{3636} = \frac{4}{11}$ and $0.\overline{1230} = \frac{410}{3333}.$ Find the remainder when $N$ is divided by $1000.$

## Solution $0.\overline{abcd}=\frac{abcd}{9999}$, $9999=9\times 11\times 101$.

Then we need to find the number of positive integers less than $10000$ that can meet the requirement. Suppose the number is $x$.

Case $1$: $\gcd (9999, x)=1$. Clearly, $x$ satisfies the condition yielding $$\varphi \left( 9999 \right) =9999\times \left( 1-\frac{1}{3} \right) \times \left( 1-\frac{1}{11} \right) \times \left( 1-\frac{1}{101} \right)=6000$$ values.

Case $2$: $3|x$ but $x$ is not a multiple of $11$ or $101.$ Then the least value of $abcd$ is $9x$, so that $x\le 1111$, $334$ values from $3$ to $1110.$

Case $3$: $11|x$ but $x$ is not a multiple of $3$ or $101$. Then the least value of $abcd$ is $11x$, so that $x\le 909$, $55$ values from $11$ to $902$.

Case $4$: $101|x$. None.

Case $5$: $3, 11|x$. Then the least value of $abcd$ is $99x$, $3$ values from $33$ to $99.$

To sum up, the answer is $$6000+334+55+3\equiv\boxed{392} \pmod{1000}.$$

## Video Solution

The problems on this page are copyrighted by the Mathematical Association of America's American Mathematics Competitions. 