1. ## Divisible by 7

The number $d_1d_2 \cdots d_9$ has nine (not necessarily distinct) decimal digits. The number $e_1e_2 \cdots e_9$ is such that each of the nine $9$-digit numbers formed by replacing just one of the digits $d_i$ is $d_1d_2 \cdots d_9$ by the corresponding digit $e_i (1 \le i \le 9)$ is divisible by $7$. The number $f_1f_2 \cdots f_9$ is related to $e_1e_2 \cdots e_9$ in the same way: that is each of the nine numbers formed by replacing one of the $e_i$ by the corresponding $f_i$ is divisible by $7$. Show that for each $i$, $d_i - f_i$ is divisible by $7$. (For example, if $d_1d_2 \cdots d_9 = 199501996$ then $e_6$ may be $2$ or $9$, since $199502996$ and $199509996$ are multiples of $7$).

I've attempt some experimentation but the numbers are too big to play around with...

how to do it?

2. Let's translate each of these sentences into equations: Letting $d=d_1 d_2 \ldots d_9$ and so on,

$d + 3^{9-i}(e_i-d_i)\equiv 0 \pmod{7}$
$e + 3^{9-i}(f_i-e_i)\equiv 0 \pmod{7}$

Summing the first equation over all i we get
$9d + e - d \equiv d+e \equiv 0 \pmod{7}.$

Summing the first two equations gives
$d+e + 3^{9-i}(f_i-d_i) \equiv 3^{9-i}(f_i-d_i) \equiv f_i-d_i \equiv 0 \pmod{7}$
since 3 and 7 are relatively prime.

3. No idea what you mean... can you show STEP BY STEP working?

4. I finally get it ... I'm not sure how you got $3^{i-1}$ though (I'm assuming it's related to the mod) ... I would use $10^{9-i}$ instead ....

usagi, the first two congruences are basically the individual replacing of digits. You start with the number $d$, then you replace one of it's digits $d_i$ by $e_i$, such that it's divisible by 7. This is the same as adding the difference between $d_i$ and $e_i$ to the appropriate digit. Multiplying the difference by $10^{9-i}$ (instead of $3^{i-1}$) will take care of which digit the difference will be added to. Same thing for converting the number $e$.

When you add together the first congruence for all $i$ (i.e. $\sum_{i=1}^{9}(d + 10^{9-i}(e_i-d_i))$, you get the third congruence.

Can you figure it out from there?

5. $3^{i-1} \equiv 10^{i-1} \pmod{7}$ since $3 \equiv 10 \pmod{7}$. The exponent in my original post is indeed wrong... I'll fix it.

6. AH!!! Hahaha ... so obvious ... I thought you used an interesting technique because of the power, but yeah ... makes sense now