problem:
A sequence $a_{1}, a_{2}, \ldots, a_{n}, \ldots$ of natural numbers is defined by the rule

$$
a_{n+1}=a_{n}+b_{n} \quad(n=1,2, \ldots)
$$

where $b_{n}$ is the last digit of $a_{n}$. Prove that such a sequence contains infinitely many powers of 2 if and only if $a_{1}$ is not divisible by 5 .

solution:
First we can observe that:

- If $a_{1}$ is divisible by 5 , then $a_{n}=a_{2}=0(\bmod 10) \forall n \geq 2$.
- If $a_{1}$ is not divisible by 5 , then for $n \geq 2: a_{n}$ is even, the sequence $b_{n}$ is periodic, its period is a cyclic permutation of $(2,4,8,6)$, and $a_{n+4}=a_{n}+20$.
(a) Let us suppose that $a_{1}$ is divisible by 5 .

Since $2^{k} \neq 0(\bmod 10)$ for any $k \in \mathbb{N}$, the sequence does not contain any power of 2 for $n \geq 2$.
(b) Let us suppose that $a_{1}$ is not divisible by 5 .

We can remark that the sequence of powers of 2 modulo 20 respects the period $(12,4,8,16)$ starting with $2^{5}=32$. We choose $j$ such that $a_{j}=2(\bmod 10)\left(\right.$ i.e. $\left.b_{j}=2\right)$ and look at the parity of its penultimate digit.

- If $a_{j}=12(\bmod 20)$, then the numbers $a_{j+4 k}, k \in \mathbb{N}$, represent all the numbers congruent to $12(\bmod 20)$ and greater than $a_{j}$, so all powers of 2 congruent to 12 $(\bmod 20)$ and greater than $a_{j}$ appear in the sequence.
- If $a_{j}=2(\bmod 20)$, then the numbers $a_{j+1+4 k}, k \in \mathbb{N}$, represent all the numbers congruent to $4(\bmod 20)$ and greater than $a_{j+1}$, so all powers of 2 congruent to 4 $(\bmod 20)$ and greater than $a_{j+1}$ appear in the sequence.

Thus, the sequence contains infinitely many powers of 2 .

Alternative 1 for (b). We choose $j$ such that $a_{j}=2(\bmod 10)$ (i.e. $\left.b_{j}=2\right)$.

- If $a_{j}=20 t+12$ for some $t \in \mathbb{N}$, then $a_{j+4 k}=a_{j}+20 k=20(t+k)+12, \forall k \in \mathbb{N}$. We obtain infinitely many powers of 2 by taking $k=\frac{2^{4 s+3}-3}{5}-t$ (with $s \in \mathbb{N}$ large enough to have $k>0)$ since $2^{4 s+3}=3(\bmod 5), \forall s \in \mathbb{N}$.
- If $a_{j}=20 t+2$ for some $t \in \mathbb{N}$, then $a_{j+1+4 k}=a_{j+1}+20 k=20(t+k)+4, \forall k \in \mathbb{N}$. We obtain infinitely many powers of 2 by taking $k=\frac{2^{4 s}-1}{5}-t$ (with $s \in \mathbb{N}$ large enough to have $k>0)$ since $2^{4 s}=1(\bmod 5), \forall s \in \mathbb{N}$.

Alternative 2 for (b). Choose $j$ such that $a_{j}$ is a multiple of 4 , i.e. $a_{j}=4 q$ (such a $j$ always exists since $a_{n+1}=a_{n}+2$ for infinitely many $n$ ). Then we have $a_{j+4 k}=a_{j}+20 k=4(q+5 k)$. Let us look for $(k, m)$ such that

$$
a_{j+4 k}=2^{m} \Longleftrightarrow 4(q+5 k)=2^{m} \Longleftrightarrow q+5 k=2^{m-2} \Longleftrightarrow 2^{m-2}=q(\bmod 5)
$$

Since $q$ could not be a multiple of 5 , we have $q \in\{1,2,3,4\}(\bmod 5)$. Since the sequence $2^{m-2}(\bmod 5)$ is periodic with period $(1,2,4,3)$, we find that $2^{m-2}=q(\bmod 5)$ happens for infinitely many values of $m$. Hence $2^{m-2}=q+5 k$ is solvable for infinitely many pairs $(k, m)$. Noting that $m$ determines $k$ and that $k$ is nonnegative as soon as $m$ is large enough concludes the proof.

Alternative 3 for (b). We shall show that for any $n>1$ there is some $k \geq n$ such that $a_{k}$ is a power of 2. First, we observe that we can always find $m \in\{n, n+1, n+2, n+3\}$ such that $a_{m}$ is divisible by 4 . If $a_{m}$ is not a power of 2 , we write $a_{m}=2^{b} c$ with $b \geq 2$ and $c>1$ odd. Then we have

$$
a_{m+4 \cdot 2^{b-2}}=a_{m}+20\left(2^{b-2}\right)=2^{b} c+5 \cdot 2^{b}=2^{b+1} \frac{c+5}{2} .
$$

If $c>5$, we have $\frac{c+5}{2}<c$ and hence the odd factor of $a_{m+4.2^{b-2}}$ is strictly smaller than the odd factor of $a_{m}$. Therefore there is some $m^{\prime}>m$ such that $a_{m^{\prime}}=2^{b^{\prime}} c^{\prime}$ with $c^{\prime}$ odd and $\leq 5$. The case $c^{\prime}=5$ is forbidden. If $c^{\prime}=1$, then $a_{m^{\prime}}$ is a power of 2 . If $c^{\prime}=3$, then $a_{m^{\prime}+4.2^{b^{\prime}-2}}=2^{b^{\prime}+3}$ is a power of 2 .

problem_match: Problem 1.

solution_match: Solution.


solution:
Rewrite the last two equations into

$$
a^{2012}-d^{2012}=2012(c-b) \text { and } c^{2012}-b^{2012}=2012(a-d)
$$

and observe that $a=d$ holds if and only if $c=b$ holds. In that case, the last two equations are satisfied, and condition $a b c d=1$ leads to a set of valid quadruples of the form $(a, b, c, d)=\left(t, \frac{1}{t}, \frac{1}{t}, t\right)$ for any $t>0$.
We show that there are no other solutions. Assume that $a \neq d$ and $c \neq b$. Multiply both sides of (1) to obtain

$$
\left(a^{2012}-d^{2012}\right)\left(c^{2012}-b^{2012}\right)=2012^{2}(c-b)(a-d)
$$

and divide the left-hand side by the (nonzero) right-hand side to get

$$
\frac{a^{2011}+\cdots+a^{2011-i} d^{i}+\cdots+d^{2011}}{2012} \cdot \frac{c^{2011}+\cdots+c^{2011-i} b^{i}+\cdots+b^{2011}}{2012}=1
$$

Now apply the arithmetic-geometric mean inequality to the first factor

$$
\frac{a^{2011}+\cdots+a^{2011-i} d^{i}+\cdots+d^{2011}}{2012}>\sqrt[2012]{(a d)^{\frac{2011 \times 2012}{2}}}=(a d)^{\frac{2011}{2}}
$$

The inequality is strict, since equality holds only if all terms in the mean are equal to each other, which happens only if $a=d$. Similarly, we find

$$
\frac{c^{2011}+\cdots+c^{2011-i} b^{i}+\cdots b^{2011}}{2012}>\sqrt[2012]{(c b)^{\frac{2011 \times 2012}{2}}}=(c b)^{\frac{2011}{2}} .
$$

Multiplying both inequalities, we obtain

$$
(a d)^{\frac{2011}{2}}(c b)^{\frac{2011}{2}}<1
$$

which is equivalent to $a b c d<1$, a contradiction.

problem_match: Problem 2.


problem: In triangle $A B C$ the midpoint of $B C$ is called $M$. Let $P$ be a variable interior point of the triangle such that $\angle C P M=\angle P A B$. Let $\Gamma$ be the circumcircle of triangle $A B P$. The line $M P$ intersects $\Gamma$ a second time in $Q$. Define $R$ as the reflection of $P$ in the tangent to $\Gamma$ in $B$. Prove that the length $|Q R|$ is independent of the position of $P$ inside the triangle.

solution:
We claim $|Q R|=|B C|$, which will clearly imply that quantity $|Q R|$ is independent from the position of $P$ inside triangle $\triangle A B C$ (and independent from the position of $A$ ).
This equality will follow from the equality between triangles $\triangle B P C$ and $\triangle R B Q$. This in turn will be shown by means of three equalities (two sides and an angle): $|B P|=|R B|,|P C|=|B Q|$ and $\angle B P C=\angle R B Q$.
![](https://cdn.mathpix.com/cropped/2024_12_15_ba09b4ac5be87f63f6f9g-4.jpg?height=849&width=1178&top_left_y=995&top_left_x=439)
(a) $|B P|=|R B|$

Obvious since $R$ is the reflection of $P$ in a line going through $B$.
(b) $|P C|=|B Q|$

Let $U$ be the fourth vertex of parallelogram $B P C U$. Then $U$ is on line $P Q$ and $\angle B U P=$ $\angle U P C=\alpha$. If $Q$ is on the same $\operatorname{arc} P B$ as $A$, then $\angle B Q P=\alpha$, and $\triangle Q P U$ is isosceles; hence, $|B Q|=|B U|=|P C|$. On the other way, if $Q$ is on the other $\operatorname{arc} P B$, then $\angle B Q P$ and $\alpha$ are supplementary, hence $B Q U=\alpha$, and again $\triangle Q P U$ is isosceles; the same conclusion follows.
(c) $\angle B P C=\angle R B Q$

Define $T$ to be the midpoint of $P R$. Then line $B T$, tangent to circle $\Gamma$ in $B$, splits $\angle R B Q$ into two parts, $\angle R B T$ and $\angle T B Q$.
We first show that $\angle R B T=\alpha$. Indeed, by symmetry, $\angle R B T=\angle P B T$ and, since $B T$ is tangent to $\Gamma$, we have that $\angle P B T=\angle P A B$ (because they both intercept the same $\operatorname{arc} \widehat{P B}$ on circle $\Gamma$ ), from which our claim follows.

We then show that $\angle T B Q=\angle B P M$. Indeed, since $\angle T B Q$ and $\angle B P Q$ intercept opposite arcs on circle $\Gamma$, they are supplementary and we have $\angle T B Q=\pi-\angle B P Q=\angle B P M$. We finally conclude that

$$
\angle R B Q=\angle R B T+\angle T B Q=\alpha+\angle B P M=\angle M P C+\angle B P M=\angle B P C
$$

We have thus shown $\triangle B P C=\triangle R B Q$, which completes the proof.

Note. Notice that point $A$ does not play any role in the problem except fixing circle $\Gamma$ (and, for that reason, the result is also valid when $P$ is chosen outside of triangle $\triangle A B C$ ).

Alternative 1 for (b). The law of sines in triangle $\triangle B Q M$ gives

$$
\frac{|B M|}{\sin \angle B Q M}=\frac{|B Q|}{\sin \angle B M Q} .
$$

Since $Q$ belongs to circle $\Gamma$, we have either $\angle B Q P=\angle B A P=\alpha$, hence $\angle B Q M=\angle M P C$, or these angles are supplementary; in both cases they have equal sines. We also have that $\angle B M Q$ and $\angle C M P$ are supplementary, hence have equal sines. Using these facts along with $|B M|=|M C|$ transforms (2) into

$$
\frac{|M C|}{\sin \angle M P C}=\frac{|B Q|}{\sin \angle C M P}
$$

from which the law of sines in triangle $\triangle C P M$ implies that $|B Q|=|P C|$.

Alternative 2 for (b). Let $S$ be the second intersection of line $C P$ with circle $\Gamma$. Then, $\angle B S P=\alpha$, so $B S$ and $M P$ are parallel; since $M$ is the midpoint of segment $B C, P$ is the midpoint of $S C$. If $Q$ is on the same $\operatorname{arc} P B$ as $A$, then the quadrilateral $Q P B S$ is an isosceles trapezoid, and $|Q B|=|S P|=|P C|$. If $Q$ is on the other arc $P B$, then the quadrilateral $P Q B S$ is an isosceles trapezoid, and again $|Q B|=|S P|=|P C|$.

problem_match: Problem 3.


problem:
Yesterday, $n \geq 4$ people sat around a round table. Each participant remembers only who his two neighbours were, but not which one sat on his left and which one sat on his right. Today, you would like the same people to sit around the same round table so that each participant has the same two neighbours as yesterday (it is possible that yesterday's lefthand side neighbour is today's right-hand side neighbour). You are allowed to query some of the participants: if anyone is asked, he will answer by pointing at his two neighbours from yesterday.
(a) Determine the minimal number $f(n)$ of participants you have to query in order to be certain to succeed, if later questions must not depend on the outcome of the previous questions. That is, you have to choose in advance the list of people you are going to query, before effectively asking any question.
(b) Determine the minimal number $g(n)$ of participants you have to query in order to be certain to succeed, if later questions may depend on the outcome of previous questions. That is, you can wait until you get the first answer to choose whom to ask the second question, and so on.

#

solution:
(a) $f(n)=n-3$.

- Asking $n-4$ questions is not enough since the $n-4$ people queried might be sitting in a consecutive string, in which case the $n-4$ answers allow one to sit $n-2$ people in the same positions as yesterday, but there is still an ambiguity among the two remaining ones.
- Let us show that $n-3$ questions suffice. Among the 3 people who are not queried, at least 2 must sit next to people who have been queried. If exactly 2 do, then both these people must be neighbours of the third, so that the neighbours of everybody are known and we are done. If all 3 unqueried people sit next to a queried person, then at least one of them has two queried neighbours, and again it follows that the neighbours of everybody are known, so that we are done.
(b) $g(n)=n-1-\left\lceil\frac{n}{3}\right\rceil\left(=n-1-\left\lfloor\frac{n+2}{3}\right\rfloor=\left\lfloor\frac{2 n}{3}\right\rfloor-1=\left\lceil\frac{2 n-5}{3}\right\rceil\right)$.

Say there is a link between two people if and only if they are neighbours. There are in total $n$ links, which we all need to identify. By asking a person for his neighbours, we can discover at most two new links. More precisely, if at any point we query a participant who has not yet been pointed as a neighbour, we discover exactly two new links (we call this a type-0 query). If we query a participant who has been pointed once as a neighbour, will discover exactly one new link (we call this a type-1 query). Of course, querying a participant who has already been pointed twice provides no information (and we assume in the rest of this solution that it never happens).
First note that, since $f(4)=1$, we also have $g(4)=1$. We now prove the formula for $g(n)$ for $n \geq 5$.

- Let us show that $n-1-\left\lceil\frac{n}{3}\right\rceil$ questions suffice. Our strategy consists in making sure that the first $\left\lceil\frac{n}{3}\right\rceil$ queries are type- 0 . Let us show that this is always possible. A type-0 query requires a participant that hasn't been queried or pointed before. Since the number of those participants decreases by three at most after each query, we see that it is always possible to perform $\left\lceil\frac{n}{3}\right\rceil$ type-0 queries first. During this phase we discover $2\left\lceil\frac{n}{3}\right\rceil$ links.
The remaining queries will be either type-0 or type-1, and each of them discovers at least one new link. We perform them until $n-1$ links have been discovered, after which we are done (the last link can be deduced without query). The number of queries in this second phase is therefore at $\operatorname{most}^{1} n-1-2\left\lceil\frac{n}{3}\right\rceil$, and the total is at $\operatorname{most}\left\lceil\frac{n}{3}\right\rceil+\left(n-1-2\left\lceil\frac{n}{3}\right\rceil\right)=n-1-\left\lceil\frac{n}{3}\right\rceil$.
- We now show that $n-2-\left\lceil\frac{n}{3}\right\rceil=\hat{g}(n)$ questions are not enough.
(i) Consider the pool of unqueried and unpointed participants ; each type-0 must query this pool. Since, from the point of view of the questioner, all elements of the pool are undistinguishable, we can assume that each type-0 query asks the second leftmost participant in the pool (except if there is only one element left in the pool). One can then check that the pool, which starts as a string of $n$ contiguous participants, will stay contiguous after each type-0 and type1 query. Furthermore, using our assumption, we see that each type-0 query removes three participants from the pool. Therefore there can be at most $\left\lceil\frac{n}{3}\right\rceil$ type-0 queries in the scenarios corresponding to our assumption.
(ii) Assume there are $k$ type-0 queries. Since there are $\hat{g}(n)$ queries, the number of discovered links is equal to $2 k+(\hat{g}(n)-k)=\hat{g}(n)+k=n-2+k-\left\lceil\frac{n}{3}\right\rceil$. If $k$ is strictly less than $\left\lceil\frac{n}{3}\right\rceil$, we discover strictly less than $n-2$ links, which is clearly insufficient (indeed, there are at least three missing links, and one can check that whatever the configuration of the missing links, there are always several orders compatible with the discovered links).
(iii) We now analyze the remaining case with $k=\left\lceil\frac{n}{3}\right\rceil$ type-0 queries ${ }^{2}$, in which we discover $n-2$ links. On the one hand, if the missing links are disjoint, there are always two orders compatible with the discovered links (for example when $n=7$ and links are missing between the $(4,5)$ and $(7,1)$ pairs of neighbours, the two orders are $1-2-3-4 \quad 5-6-7$ and $1-2-3-4 \quad 7-6-5)$. On the other hand, a situation where the two missing links would be adjacent would allow the identification of the correct order. However, this never happens in the scenarios corresponding to the assumption we made in (i). Indeed, two adjacent missing links imply that some participant is unqueried and unpointed at the end of the process. Since we perform $k=\left\lceil\frac{n}{3}\right\rceil$ type-0 queries (the maximum), the reasoning from (i) shows that the pool of unqueried and unpointed participants is empty at the end of the process, which contradicts the existence of two adjacent missing links.

[^0]
[^0]:    ${ }^{1}$ Here we use the assumption $n \geq 5$, since quantity $n-1-2\left\lceil\frac{n}{3}\right\rceil$ is negative when $n=4$.
    ${ }^{2}$ Note that this cannot happen when $n \in\{4,5,7\}$ since we have $\left\lceil\frac{n}{3}\right\rceil>\hat{g}(n)$ in those cases.

problem_match: Problem 4.

solution_match: # Solution.