Rubanov I.S.

Petya came up with 1004 reduced quadratic trinomials $f_{1}, \ldots, f_{1004}$, among the roots of which are all integers from 0 to 2007. Vasya considers all possible equations $f_{i}=f_{j}$ ( $i \neq j$ ), and for each root found, Petya pays Vasya one ruble. What is the smallest possible income for Vasya?
Let $f_{1}(x)=x(x-2007), f_{2}(x)=(x-1)(x-2006), f_{1004}(x)=(x-1003)(x-1004)$. All these trinomials are pairwise distinct because they have different roots, but the coefficient of $x$ in each of them is -2007. Therefore, the difference between any two of them is a constant, different from 0, which means that no equation $f_{n}(x)=f_{m}(x)$ has solutions.

Answer

0.

Petya thought of a natural number and for each pair of its digits, he wrote down their difference on the board. After that, he erased some differences, and the numbers $2,0,0,7$ remained on the board. What is the smallest number Petya could have thought of?

## Solution

Answer: 11138. Indeed, the number 11138 could have been thought of: $2=3-1,0=1-1,7=8-1$. Suppose the number thought of is $N1$, then among the differences of the digits, only the numbers $0,1, a, a-1$ appear, which is impossible. Otherwise, the number $N$ does not contain zeros, and $N=\overline{111 b c}$, where $b=2$ or $b=3$ (since $N<11138$). Then $c \geq 1+7=8$, from which $b \neq 3$. But if $b=2$, then among the differences of the digits, only the numbers $0,1, c-1, c-2$ appear. Contradiction.

## Answer

11138