Pista thought of a three-digit (integer) number with Erzsi, then from the answer obtained at the end of the following sequence of instructions, he was able to tell the number thought of in one go. How did Pista do this?

- 1. Write down the number twice in a row to get a six-digit number!
- 2. Add $a_{1}=3514$ to it! (The further transformations are of course to be performed on the last number obtained)
- 3. Divide by $d_{1}=7$!
- 4. Add $a_{2}=3524$ to it!
- 5. Divide by $d_{2}=11$!
- 6. Add $a_{3}=3534$ to it!
- 7. Divide by $d_{3}=13$!
- 8. Tell the quotient!
In the described six-digit number, the (from left) first three digits represent the thousand times of the following three-digit number (the thought $N$ number), so the six-digit number in front of us is $1001 N$. Thus, after the 2nd and 3rd steps, the number on Erzsi's paper was

$$
N_{1}=\frac{1001 N+3514}{7}=143 N+502
$$

After the 4th and 5th steps,

$$
N_{2}=\frac{N_{1}+3524}{11}=\frac{143 N+4026}{11}=13 N+366
$$

Finally, the quotient spoken was:

$$
N_{3}=\frac{N_{2}+3534}{13}=\frac{13 N+3900}{13}=N+300
$$

It is no wonder that Pista immediately spoke the thought number.

In the example, every division was without a remainder (which is an unspoken "law" of such games), because the product of the numbers used as divisors is a divisor of the multiplier implicitly used in writing $N$ twice in a row, indeed $d_{1} d_{2} d_{3}=7 \cdot 11 \cdot 13=1001$. And the magic of the guess simplified to a mere subtraction because the coefficient of $N$ in $N_{3}$ was 1, because the product of the divisors used in the process was exactly 1001. (If Pista had asked Erzsi for $N_{2}$, he would have had to perform a division in addition to subtraction to calculate $N$.) For the division to be without a remainder, it was also necessary that the addend $a_{1}$ be divisible by the subsequent $d_{1}$, and $a_{2}$ and $a_{3}$ together with the 502 and 366 surplus that appeared in front of us, respectively, give a number divisible by $d_{2}$ and $d_{3}$.

According to these, many other numbers could have been used in place of $a_{1}, a_{2}, a_{3}$, but only the given ones, possibly in a different order, in place of $d_{1}, d_{2}, d_{3}$.

II. The writing of a two-digit number three times in a row is similar to the multiplication by 10101, and the factorization of the base number is $10101=3 \cdot 7 \cdot 13 \cdot 37$. Thus, in the desired procedure, we must reach the number to be spoken in at most four segments - four additions and four divisions - (we can divide by the product of two prime factors at once, e.g., 3$\cdot$7=21, in which case the number of segments is less). One possible choice for the addends and the order is:

$$
a_{1}=342, d_{1}=3 ; a_{2}=348, d_{2}=7 ; \quad a_{3}=363, d_{3}=13 ; a_{4}=374, d_{4}=37
$$

with these, the number to be subtracted from the spoken number is 11.

József Vezse (Debrecen, Péchy M. ép. ip. t. II. o. t.)

Remark. Margit Ábra (Budapest, Berzsenyi D. ig. II. o. t.) gave addends that also resemble the given example in that $a_{2}-a_{1}=$ $a_{3}-a_{2}=10$, and the surplus of the spoken number compared to the thought one is also $A=300$. This fortunate coincidence is that the

$$
\frac{\left[\left(10101 N+a_{1}\right) / 7+\left(a_{1}+10\right)\right] / 13+\left(a_{1}+20\right)}{111}=N+300
$$

equation (for $a_{1}$) has an integer solution. Generally, in a three-segment procedure and denoting the increase of the addends by $D$, the

$$
\frac{\left[\left(d_{1} d_{2} d_{3} N+a_{1}\right) / d_{1}+\left(a_{1}+D\right)\right] / d_{2}+\left(a_{1}+2 D\right)}{d_{3}}=N+A
$$

equation yields

$$
a_{1}=\frac{d_{1} d_{2} d_{3} A-d_{1}\left(2 d_{2}+1\right) D}{1+d_{1}\left(d_{2}+1\right)}
$$

and this is an integer only for specific pairs of values of $A$ and $D$. - In other words: after choosing $D$, it is not always possible to find an integer $A$ such that $a_{1}$ is also an integer.