# 2008 iTest Problems/Problem 39

## Problem

Let $\phi(n)$ denote $\textit{Euler's phi function}$, the number of integers $1\leq i\leq n$ that are relatively prime with $n$. (For example, $\phi(6)=2$ and $\phi(10)=4$.) Let $S=\sum_{d|2008}\phi(d)$, where $d$ ranges through all positive divisors of $2008$, including $1$ and $2008$. Find the remainder when $S$ is divided by $1000$.

## Solution

The divisors of $2008$ are $1$, $2$, $4$, $8$, $251$, $502$, $1004$, and $2008$, so the problem requires the sum of the number of numbers relatively prime to each of the eight numbers.

Using the formula $\phi(n) = n \cdot (1 - \tfrac{1}{p_1})(1 - \tfrac{1}{p_2}) \cdots (1 - \tfrac{1}{p_n})$ (or by manually counting the numbers relatively prime to each number), $1$ number is relatively prime to $1$, $1$ number is relatively prime to $2$, $2$ numbers are relatively prime to $4$, $4$ numbers are relatively prime to $8$, $250$ numbers are relatively prime to $251$, $250$ numbers are relatively prime to $502$, $500$ numbers are relatively prime to $1004$, and $1000$ numbers are relatively prime to $2008$. That means $S = 2008$, and the remainder when $S$ is divided by $1000$ is $\boxed{8}$.

## Extra Note

If all the divisors of an integer n are { ${d_1}$, ${d_2}$, ${d_3}$, ... ${d_k}$}, then n = $\phi({d_1})$ + $\phi({d_2})$ + .... + $\phi({d_k})$. This provides a shorter approach in this problem because it asks about the sum of the number of numbers co prime to 2008's divisors, as mentioned earlier. This is 2008 itself.

## Proof

Let $n$ = ${p_1}^{\alpha_1}$ ${p_2}^{\alpha_2}$.... ${p_k}^{\alpha_k}$ where ${p_1}, {p_2}, ... {p_k}$ are prime numbers

and

{ ${d_1}$, ${d_2}$, .... ${d_m}$} is an exhaustive, mutually exclusive list of $n$'s factors $\phi({d_1})$ + $\phi({d_2})$ + ... + $\phi({d_m})$

= ${p_1}(1-\frac{1}{p_1})$ + ${p_2}(1-\frac{1}{p_2})$ + ${p_1} {p_2}(1-\frac{1}{p_1})(1-\frac{1}{p_2})$...

The above term represents the sum of all the values of the the totient function applied of all of n's divisors, like the problem is asking.

= $(1 - \frac{1}{p_1})$ $(1 - \frac{1}{p_2})$ $({p_1} + {p_1}^{2} + ... + {p_1}^{\alpha_1})$ $({p_2} + {p_2}^{2} + ... + {p_2}^{\alpha_2})$ + ....

= $(1 + (1 - \frac{1}{p_1})$ $({p_1} + {p_1}^{2} + ... + {p_1}^{\alpha_1})$) $(1 + (1 - \frac{1}{p_2})$ $({p_2} + {p_2}^{2} + ... + {p_2}^{\alpha_2})$) ... $(1 + (1 - \frac{1}{p_k})$ $({p_k} + {p_k}^{2} + ... + {p_k}^{\alpha_k})$

= $(1 + {p_1} + {p_1}^{2} + ... + {p_1}^{\alpha_1} - (1 + {p_1} + {p_1}^{2} + ... + {p_1}^{\alpha_1 - 1}))$ x $(1 + {p_2} + {p_2}^{2} + ... + {p_2}^{\alpha_2} - (1 + {p_2} + {p_2}^{2} + ... + {p_2}^{\alpha_2 - 1}))$ x ... $(1 + {p_k} + {p_k}^{2} + ... + {p_k}^{\alpha_k} - (1 + {p_k} + {p_k}^{2} + ... + {p_k}^{\alpha_k - 1}))$

= ${p_1}^{\alpha_1}$ ${p_2}^{\alpha_2}$ ... ${p_k}^{\alpha_k}$

= $n$