exam: INMO

problem: Let $A B C$ be a right-angled triangle with $\angle B=90^{\circ}$. Let $B D$ be the altitude from $B$ on to $A C$. Let $P, Q$ and $I$ be the incentres of triangles $A B D, C B D$ and $A B C$ respectively. Show that the circumcentre of of the triangle $P I Q$ lies on the hypotenuse $A C$.

solution:
We begin with the following lemma:

Lemma: Let $X Y Z$ be a triangle with $\angle X Y Z=90+\alpha$. Construct an isosceles triangle $X E Z$, externally on the side $X Z$, with base angle $\alpha$. Then $E$ is the circumcentre of $\triangle X Y Z$.

Proof of the Lemma: Draw $E D \perp$ $X Z$. Then $D E$ is the perpendicular bisector of $X Z$. We also observe that $\angle X E D=\angle Z E D=90-\alpha$. Observe that $E$ is on the perpendicular bisector of $X Z$. Construct the circumcircle of $X Y Z$. Draw perpendicular bisector of $X Y$ and let it meet $D E$ in $F$. Then $F$ is the circumcentre of $\triangle X Y Z$. Join $X F$. Then $\angle X F D=90-\alpha$. But we know

![](https://cdn.mathpix.com/cropped/2024_06_05_bbce4552b5cb7766b61bg-1.jpg?height=493&width=385&top_left_y=1000&top_left_x=1312)
that $\angle X E D=90-\alpha$. Hence $E=F$. Let $r_{1}, r_{2}$ and $r$ be the inradii of the triangles $A B D, C B D$ and $A B C$ respectively. Join $P D$ and $D Q$. Observe that $\angle P D Q=90^{\circ}$. Hence

$$
P Q^{2}=P D^{2}+D Q^{2}=2 r_{1}^{2}+2 r_{2}^{2}
$$

Let $s_{1}=(A B+B D+D A) / 2$. Observe that $B D=c a / b$ and $A D=$ $\sqrt{A B^{2}-B D^{2}}=\sqrt{c^{2}-\left(\frac{c a}{b}\right)^{2}}=c^{2} / b$. This gives $s_{1}=c s / b$. But $r_{1}=$ $s_{1}-c=(c / b)(s-b)=c r / b$. Similarly, $r_{2}=a r / b$. Hence

$$
P Q^{2}=2 r^{2}\left(\frac{c^{2}+a^{2}}{b^{2}}\right)=2 r^{2}
$$

Consider $\triangle P I Q$. Observe that $\angle P I Q=90+(B / 2)=135$. Hence $P Q$ subtends $90^{\circ}$ on the circumference of the circumcircle of $\triangle P I Q$. But we have seen that $\angle P D Q=90^{\circ}$. Now construct a circle with $P Q$ as diameter. Let it cut $A C$ again in $K$. It follows that $\angle P K Q=90^{\circ}$ and the points $P, D, K, Q$ are concyclic. We also notice $\angle K P Q=\angle K D Q=45^{\circ}$

![](https://cdn.mathpix.com/cropped/2024_06_05_bbce4552b5cb7766b61bg-1.jpg?height=452&width=800&top_left_y=2219&top_left_x=1194)
and $\angle P Q K=\angle P D A=45^{\circ}$.

Thus $P K Q$ is an isosceles right-angled triangle with $K P=K Q$. Therfore $K P^{2}+K Q^{2}=P Q^{2}=2 r^{2}$ and hence $K P=K Q=r$.

Now $\angle P I Q=90+45$ and $\angle P K Q=2 \times 45^{\circ}=90^{\circ}$ with $K P=K Q=r$.

Hence $K$ is the circumcentre of $\triangle P I Q$.

(Incidentally, This also shows that $K I=r$ and hence $K$ is the point of contact of the incircle of $\triangle A B C$ with $A C$.)

solution_match: Solution:


solution:
Here we use computation to prove that the point of contact $K$ of the incircle with $A C$ is the circumcentre of $\triangle P I Q$. We show that $K P=K Q=r$. Let $r_{1}$ and $r_{2}$ be the inradii of triangles $A B D$ and $C B D$ respectively. Draw $P L \perp A C$ and $Q M \perp A C$. If $s_{1}$ is the semiperimeter of $\triangle A B D$, then $A L=s_{1}-B D$.

![](https://cdn.mathpix.com/cropped/2024_06_05_bbce4552b5cb7766b61bg-2.jpg?height=463&width=786&top_left_y=755&top_left_x=1206)

But

$$
s_{1}=\frac{A B+B D+D A}{2}, \quad B D=\frac{c a}{b}, \quad A D=\frac{c^{2}}{b}
$$

Hence $s_{1}=c s / b$. This gives $r_{1}=s_{1}-c=c r / b, A L=s_{1}-B D=c(s-a) / b$. Hence $K L=A K-A L=(s-a)-\frac{c(s-a)}{b}=\frac{(b-c)(s-a)}{b}$. We observe that $2 r^{2}=\frac{(c+a-b)^{2}}{2}=\frac{c^{2}+a^{2}+b^{2}-2 b c-2 a b+2 c a}{2}=\left(b^{2}-b a-b c+a c\right)=(b-c)(b-a)$.

This gives

$$
\begin{aligned}
(s-a)(b-c)=(s-b+b-a) & (b-c)=r(b-c)+(b-a)(b-c) \\
& =r(b-c)+2 r^{2}=r(b-c+c+a-b)=r a
\end{aligned}
$$

Thus $K L=r a / b$. Finally,

$$
K P^{2}=K L^{2}+L P^{2}=\frac{r^{2} a^{2}}{b^{2}}+\frac{r^{2}+c^{2}}{b^{2}}=r^{2}
$$

Thus $K P=r$. Similarly, $K Q=r$. This gives $K P=K I=K Q=r$ and therefore $K$ is the circumcentre of $\triangle K I Q$.

(Incidentally, this also shows that $K L=c a / b=r_{2}$ and $K M=r_{1}$.)

solution_match: Solution 2:


problem: For any natural number $n>1$, write the infinite decimal expansion of $1 / n$ (for example, we write $1 / 2=0.4 \overline{9}$ as its infinite decimal expansion, not 0.5 ). Determine the length of the non-periodic part of the (infinite) decimal expansion of $1 / n$.

solution:
For any prime $p$, let $\nu_{p}(n)$ be the maximum power of $p$ dividing $n$; ie $p^{\nu_{p}(n)}$ divides $n$ but not higher power. Let $r$ be the
length of the non-periodic part of the infinite decimal expansion of $1 / n$.

Write

$$
\frac{1}{n}=0 . a_{1} a_{2} \cdots a_{r} \overline{b_{1} b_{2} \cdots b_{s}}
$$

We show that $r=\max \left(\nu_{2}(n), \nu_{5}(n)\right)$.

Let $a$ and $b$ be the numbers $a_{1} a_{2} \cdots a_{r}$ and $b=b_{1} b_{2} \cdots b_{s}$ respectively. (Here $a_{1}$ and $b_{1}$ can be both 0.) Then

$$
\frac{1}{n}=\frac{1}{10^{r}}\left(a+\sum_{k \geq 1} \frac{b}{\left(10^{s}\right)^{k}}\right)=\frac{1}{10^{r}}\left(a+\frac{b}{10^{s}-1}\right)
$$

Thus we get $10^{r}\left(10^{s}-1\right)=n\left(\left(10^{s}-1\right) a+b\right)$. It shows that $r \geq$ $\max \left(\nu_{2}(n), \nu_{5}(n)\right)$. Suppose $r>\max \left(\nu_{2}(n), \nu_{5}(n)\right)$. Then 10 divides $b-a$. Hence the last digits of $a$ and $b$ are equal: $a_{r}=b_{s}$. This means

$$
\frac{1}{n}=0 . a_{1} a_{2} \cdots a_{r-1} \overline{b_{s} b_{1} b_{2} \cdots b_{s-1}}
$$

This contradicts the definition of $r$. Therefore $r=\max \left(\nu_{2}(n), \nu_{5}(n)\right)$.


problem:
Find all real functions $f$ from $\mathbb{R} \rightarrow \mathbb{R}$ satisfying the relation

$$
f\left(x^{2}+y f(x)\right)=x f(x+y)
$$

solution:
Put $x=0$ and we get $f(y f(0))=0$. If $f(0) \neq 0$, then $y f(0)$ takes all real values when $y$ varies over real line. We get $f(x) \equiv 0$. Suppose $f(0)=0$. Taking $y=-x$, we get $f\left(x^{2}-x f(x)\right)=0$ for all real $x$.

Suppose there exists $x_{0} \neq 0$ in $\mathbb{R}$ such that $f\left(x_{0}\right)=0$. Putting $x=x_{0}$ in the given relation we get

$$
f\left(x_{0}^{2}\right)=x_{0} f\left(x_{0}+y\right)
$$

for all $y \in \mathbb{R}$. Now the left side is a constant and hence it follows that $f$ is a constant function. But the only constant function which satisfies the equation is identically zero function, which is already obtained. Hence we may consider the case where $f(x) \neq 0$ for all $x \neq 0$.

Since $f\left(x^{2}-x f(x)\right)=0$, we conclude that $x^{2}-x f(x)=0$ for all $x \neq 0$. This implies that $f(x)=x$ for all $x \neq 0$. Since $f(0)=0$, we conclude that $f(x)=x$ for all $x \in R$.

Thus we have two functions: $f(x) \equiv 0$ and $f(x)=x$ for all $x \in \mathbb{R}$.


problem:
There are four basket-ball players $A, B, C, D$. Initially, the ball is with $A$. The ball is always passed from one person to a different person. In how many ways can the ball come back to $A$ after seven passes? (For example $A \rightarrow C \rightarrow B \rightarrow D \rightarrow A \rightarrow B \rightarrow C \rightarrow A$ and
$A \rightarrow D \rightarrow A \rightarrow D \rightarrow C \rightarrow A \rightarrow B \rightarrow A$ are two ways in which the ball can come back to $A$ after seven passes.)

solution:
Let $x_{n}$ be the number of ways in which $A$ can get back the ball after $n$ passes. Let $y_{n}$ be the number of ways in which the ball goes back to a fixed person other than $A$ after $n$ passes. Then

$$
x_{n}=3 y_{n-1} \text {, }
$$

and

$$
y_{n}=x_{n-1}+2 y_{n-1}
$$

We also have $x_{1}=0, x_{2}=3, y_{1}=1$ and $y_{2}=2$.

Eliminating $y_{n}$ and $y_{n-1}$, we get $x_{n+1}=3 x_{n-1}+2 x_{n}$. Thus

$$
\begin{aligned}
& x_{3}=3 x_{1}+2 x_{2}=2 \times 3=6 \\
& x_{4}=3 x_{2}+2 x_{3}=(3 \times 3)+(2 \times 6)=9+12=21 \\
& x_{5}=3 x_{3}+2 x_{4}=(3 \times 6)+(2 \times 21)=18+42=60 \\
& x_{6}=3 x_{4}+2 x_{5}=(3 \times 21)+(2 \times 60)=63+120=183 \\
& x_{7}=3 x_{5}+2 x_{6}=(3 \times 60)+(2 \times 183)=180+366=546
\end{aligned}
$$

Alternate solution: Since the ball goes back to one of the other 3 persons, we have

$$
x_{n}+3 y_{n}=3^{n}
$$

since there are $3^{n}$ ways of passing the ball in $n$ passes. Using $x_{n}=$ $3 y_{n-1}$, we obtain

$$
x_{n-1}+x_{n}=3^{n-1}
$$

with $x_{1}=0$. Thus

$$
\begin{array}{r}
x_{7}=3^{6}-x_{6}=3^{6}-3^{5}+x_{5}=3^{6}-3^{5}+3^{4}-x_{4}=3^{6}-3^{5}+3^{4}-3^{3}+x_{3} \\
=3^{6}-3^{5}+3^{4}-3^{3}+3^{2}-x_{2}=3^{6}-3^{5}+3^{4}-3^{3}+3^{2}-3 \\
=\left(2 \times 3^{5}\right)+\left(2 \times 3^{3}\right)+(2 \times 3)=486+54+6=546
\end{array}
$$


problem:
Let $A B C D$ be a convex quadrilateral. Let the diagonals $A C$ and $B D$ intersect in $P$. Let $P E, P F, P G$ and $P H$ be the altitudes from $P$ on to the sides $A B, B C, C D$ and $D A$ respectively. Show that $A B C D$ has an incircle if and only if

$$
\frac{1}{P E}+\frac{1}{P G}=\frac{1}{P F}+\frac{1}{P H}
$$

solution:
Let $A P=p, B P=q, C P=r, D P=s ; A B=a, B C=b$, $C D=c$ and $D A=d$. Let $\angle A P B=\angle C P D=\theta$. Then $\angle B P C=\angle D P A=$ $\pi-\theta$. Let us also write $P E=h_{1}, P F=h_{2}, P G=h_{3}$ and $P H=h_{4}$.

![](https://cdn.mathpix.com/cropped/2024_06_05_bbce4552b5cb7766b61bg-5.jpg?height=542&width=532&top_left_y=347&top_left_x=642)

## Observe that

$$
h_{1} a=p q \sin \theta, \quad h_{2} b=q r \sin \theta, \quad h_{3} c=r s \sin \theta, \quad h_{4} d=s p \sin \theta
$$

Hence

$$
\frac{1}{h_{1}}+\frac{1}{h_{3}}=\frac{1}{h_{2}}+\frac{1}{h_{4}}
$$

is equivalent to

$$
\frac{a}{p q}+\frac{c}{r s}=\frac{b}{q r}+\frac{d}{s p}
$$

This is the same as

$$
a r s+c p q=b s p+d q r
$$

Thus we have to prove that $a+c=b+d$ if and only if $a r s+c p q=b s p+d q r$. Now we can write $a+c=b+d$ as

$$
a^{2}+c^{2}+2 a c=b^{2}+d^{2}+2 b d
$$

But we know that

$$
\begin{aligned}
& a^{2}=p^{2}+q^{2}-2 p q \cos \theta, \quad c^{2}=r^{2}+s^{2}-2 r s \cos \theta \\
& b^{2}=q^{2}+r^{2}+2 q r \cos \theta, \quad d^{2}=p^{2}+s^{2}+2 p s \cos \theta
\end{aligned}
$$

Hence $a+c=b+d$ is equivalent to

$$
-p q \cos \theta+-r s \cos \theta+a c=p s \cos \theta+q r \cos \theta+b d
$$

Similarly, by squaring ars $+c p q=b s p+d q r$ we can show that it is equivalent to

$$
-p q \cos \theta+-r s \cos \theta+a c=p s \cos \theta+q r \cos \theta+b d
$$

We conclude that $a+c=b+d$ is equivalent to $c p q+a r s=b p s+d q r$. Hence $A B C D$ has an in circle if and only if

$$
\frac{1}{h_{1}}+\frac{1}{h_{3}}=\frac{1}{h_{2}}+\frac{1}{h_{4}}
$$


problem:
From a set of 11 square integers, show that one can choose 6 numbers $a^{2}, b^{2}, c^{2}, d^{2}, e^{2}, f^{2}$ such that

$$
a^{2}+b^{2}+c^{2} \equiv d^{2}+e^{2}+f^{2} \quad(\bmod 12)
$$

solution:
The first observation is that we can find 5 pairs of squares such that the two numbers in a pair have the same parity. We can see this as follows:

| Odd numbers | Even numbers | Odd pairs | Even pairs | Total pairs |
| :---: | :---: | :---: | :---: | :---: |
| 0 | 11 | 0 | 5 | 5 |
| 1 | 10 | 0 | 5 | 5 |
| 2 | 9 | 1 | 4 | 5 |
| 3 | 8 | 1 | 4 | 5 |
| 4 | 7 | 2 | 3 | 5 |
| 5 | 6 | 2 | 3 | 5 |
| 6 | 5 | 3 | 2 | 5 |
| 7 | 4 | 3 | 2 | 5 |
| 8 | 3 | 4 | 1 | 5 |
| 9 | 2 | 4 | 1 | 5 |
| 10 | 1 | 5 | 0 | 5 |
| 11 | 0 | 5 | 0 | 5 |

Let us take such 5 pairs: say $\left(x_{1}^{2}, y_{1}^{2}\right),\left(x_{2}^{2}, y_{2}^{2}\right), \ldots,\left(x_{5}^{2}, y_{5}^{2}\right)$. Then $x_{j}^{2}-y_{j}^{2}$ is divisible by 4 for $1 \leq j \leq 5$. Let $r_{j}$ be the remainder when $x_{j}^{2}-y_{j}^{2}$ is divisible by $3,1 \leq j \leq 3$. We have 5 remainders $r_{1}, r_{2}, r_{3}, r_{4}, r_{5}$. But these can be 0,1 or 2 . Hence either one of the remainders occur 3 times or each of the remainders occur once. If, for example $r_{1}=r_{2}=r_{3}$, then 3 divides $r_{1}+r_{2}+r_{3}$; if $r_{1}=0, r_{2}=1$ and $r_{3}=2$, then again 3 divides $r_{1}+r_{2}+r_{3}$. Thus we can always find three remainders whose sum is divisible by 3 . This means we can find 3 pairs, say, $\left(x_{1}^{2}, y_{1}^{2}\right),\left(x_{2}^{2}, y_{2}^{2}\right),\left(x_{3}^{2}, y_{3}^{2}\right)$ such that 3 divides $\left(x_{1}^{2}-y_{1}^{2}\right)+\left(x_{2}^{2}-y_{2}^{2}\right)+\left(x_{3}^{2}-y_{3}^{2}\right)$. Since each difference is divisible by 4 , we conclude that we can find 6 numbers $a^{2}, b^{2}, c^{2}, d^{2}, e^{2}, f^{2}$ such that

$$
a^{2}+b^{2}+c^{2} \equiv d^{2}+e^{2}+f^{2} \quad(\bmod 12)
$$