Jóska gave his friends the following task.

I multiplied an integer by 23 and added 1, then multiplied the sum by 11. I multiplied the product by 23 again and added 1, then multiplied by 33, and finally by 77. I moved the last digit of the latest product to the beginning of the number, divided the resulting number by its first digit, and then I got back the number before the rearrangement. - Find out what my starting number was!

Pista peeked at Jóska's paper and saw that the starting number ended with several 7s. Using this information, they could quickly determine Jóska's number.

Calculate Jóska's number. - Would the data Pista obtained be necessary?
a) Since Jóska's number ended in a 7, the last digit of its 23-fold increased by 1 was 2, because the last digit of the product (and sum) is determined solely by the last digits of the factors (or terms), and the last digit of $7 \cdot 3 + 1$ is 2. Similarly, the last digit of the 11-fold sum is also 2. Moving forward, the 23-fold product of the number increased by 1 ended in 6, and the number itself ended in 7, which returned after the last two multiplications as well, because the last digit of the product $33 \cdot 77$ is 1.

Let's denote the number obtained by removing the last 7 from the final product by $A$, and the number of its digits by $k$. Then the number is $10A + 7$, and the number obtained by writing 7 in front of it is $7 \cdot 10^k + A$, since subtracting $A$ from the new number leaves 7 followed by $k$ zeros. Therefore, based on Jóska's final message,

$$
\frac{7 \cdot 10^k + A}{7} = 10A + 7, \quad A = \frac{7 \cdot 10^k - 49}{69}
$$

Thus, $A$ is the quotient of a division where the divisor is 69, the remainder is 49, and the dividend is a number consisting of a 7 followed by $k$ (unknown) zeros. Conversely: if we stop at the first place in the division $700 \ldots : 69$ where the remainder is 49, then the quotient will be suitable for $A$.

Stopping at the first such place, we get the following for $A$, then for $10A + 7$, the multiplicand before the multiplication by 77, and thus for the results of the subsequent operations performed by Jóska, in reverse order:

| $A$ |  | 101 | 449 | 275 | 362 | 318 | 840 | 579 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $10A + 7 = B$ | 1 | 014 | 492 | 753 | 623 | 188 | 405 |  |
| $: 77 = C$ |  | 13 | 175 | 230 | 566 | 534 | 14 |  |
| $: 33 = D$ |  |  | 399 | 249 | 411 | 107 | 118 |  |
| $23 = E$ |  |  | 17 | 358 | 670 | 048 | 135 |  |
| $E : 11 = $ |  |  | 1 | 578 | 060 | 913 | 466 |  |
| $(F - 1) : 23 = $ |  |  |  | 68 | 611 | 344 | 063 |  |

The last one could have been Jóska's starting number.

We note that if the sequence of reverse calculations did not result in an integer at every step, we could have tried the number that is the quotient of the division $700 \ldots : 69$ at the point where the remainder 49 appears for the second, third, ..., $k$-th time, i.e., the number $\overline{A 7 A}$ (43 digits), $\overline{A 7 A 7 A}$ (65 digits), ..., since when the last (9th) digit of $A$ is written, 49 remains with 0 subtracted from the quotient, the remainder is also 7, and from here the digits of $A$ repeat.

b) Pista's data would have been unnecessary if, trying any digit $J$ at the end of Jóska's number, we always got 7 as the digit to be written in front and as the divisor. However, this is not the case, because the last digit of the numbers formed in sequence is $3J, 3J + 1$ (twice in a row), $9J + 3, 9J + 4$, and after the last two multiplications, again $9J + 4$, or the last digit of this number. This can also be written as $4 - J$ or $14 - J$, so for each $J$, the digit to be written in front and the divisor would be different. Only with $J = 4$ and $J = 3$ would we not need to try, as the former would lead to a zero divisor, and the latter to a number written with an arbitrary number of 1s, i.e., an indeterminate number.

It is not clear how long a calculation we would have to perform to arrive at the above solution, or at a possible other solution, without this.

Note. The number $A$ can also be obtained by multiplication. Reversing the order of the last 3 steps: $A$ is a number that, after the following 3 modifications, we get back: I. we write a 7 at the end, II. we multiply the new number by 7, III. we remove a 7 from the beginning of the product. Thus, according to I. and II., the last digit of the product is the 9 from $7 \cdot 7 = 49$, which is the unit digit of $A$, and also the tens place digit of the multiplicand; therefore, the tens place digit of the product is the 7 from $7 \cdot 9 + 4 = 67$, which is the hundreds place digit of the multiplicand; therefore, the hundreds place digit of the product is the 5 from $7 \cdot 7 + 6 = 55$, the thousands place digit is the 0 from $7 \cdot 5 + 5 = 40$, and so on.

We can stop at such a place in this procedure where we write a 7 and there is no carry, then we get $A$ by removing this 7, according to III. We stopped at the first possible place, where the 22nd digit of the product was the 7 without a remainder. Moving forward, the 44th, 66th, ..., $22k$, ... digits - always the 7 - would be suitable places to stop.

2. A deeper remark can be read on page 193 of this number.