## Task 3 - 221213

In an old arithmetic book, the following method for multiplying the number 142857 by a natural number $n$, which is greater than 7, is given:

|  | Example for $n=326$ |
| :--- | :--- |
| First, divide $n$ by 7 | $(326: 7=46$, remainder 4) |
| and write down the |  |
| integer part of the result. | 46 |
| Then multiply 142857 by the remainder | $(142857 \cdot 4=571428)$ |
| and write the product behind the first written number. | 46571428 |
| From the number thus formed, subtract | -46 |
| the first written number. | $46571382=142857 \cdot 326$ |

However, it turns out that this method does not lead to the correct result for all natural numbers $n>7$.

a) Determine all natural numbers $n$ with $n>7$ for which the method leads to the correct result!

b) Name and justify for the other $n>7$ a method that leads to the correct result, which also avoids multiplying 142857 by a number greater than 7 and starts with the division of $n$ by 7!
a) If $q$ is the integer part and $r$ is the remainder when a natural number $n>7$ is divided by 7, then

$$
n=7 q+r \quad \text { and } \quad 0 \leq r \leq 6
$$

Multiplying 142857 by $r$ yields a product $p=142857 \cdot r$, which

- in the case $r=0$ has the value $p=0$ and
- in the case $1 \leq r \leq 6$ satisfies the inequality $142857 \leq p \leq 142857 \cdot 6=857142$, so it is a six-digit number.

Therefore, the given procedure

- in the case $r=0$ results in the number $q \cdot 10-q=9 q$,
- in the case $1 \leq r \leq 6$ results in the number $q \cdot 10^{5}+p-q=999999 q+142857 r$.

On the other hand, the desired product in every case is, according to (1), the number

$$
142857 n=142857(7 q+r)=999999 q+142857 r
$$

Comparison shows: The procedure leads to the correct result for exactly those $n>7$ for which the case $1 \leq r \leq 6$ applies, which are exactly those $n>7$ that are not divisible by 7.

b) The simplest method would be, instead of $n=7 q+r$ with $r=0$, to use the assumption $n=7 q+7$ with $r=7$ and then proceed as described. 

Adapted from [5]