exam: HMMT

problem:
You are trying to sink a submarine. Every second, you launch a missile at a point of your choosing on the $x$-axis. If the submarine is at that point at that time, you sink it. A firing sequence is a sequence of real numbers that specify where you will fire at each second. For example, the firing sequence $2,3,5,6, \ldots$ means that you will fire at 2 after one second, 3 after two seconds, 5 after three seconds, 6 after four seconds, and so on.
(a) [5] Suppose that the submarine starts at the origin and travels along the positive $x$-axis with an (unknown) positive integer velocity. Show that there is a firing sequence that is guaranteed to hit the submarine eventually.

solution:
The firing sequence $1,4,9, \ldots, n^{2}, \ldots$ works. If the velocity of the submarine is $v$, then after $v$ seconds it will be at $x=v^{2}$, the same location where the mine explodes at time $v$.
(b) [10] Suppose now that the submarine starts at an unknown integer point on the non-negative $x$-axis and again travels with an unknown positive integer velocity. Show that there is still a firing sequence that is guaranteed to hit the submarine eventually.

solution_match: Solution:


solution:
Represent the submarine's motion by an ordered pair ( $a, b$ ), where $a$ is the starting point of the submarine and $b$ is its velocity. We want to find a way to map each positive integer to a possible ordered pair so that every ordered pair is covered. This way, if we fire at $b_{n} n+a_{n}$ at time $n$, where $\left(a_{n}, b_{n}\right)$ is the point that $n$ maps to, then we will eventually hit the submarine. (Keep in mind that $b_{n} n+a_{n}$ would be the location of the submarine at time $n$.) There are many such ways to map the positive integers to possible points; here is one way:

$$
\begin{aligned}
& 1 \rightarrow(1,1), 2 \rightarrow(2,1), 3 \rightarrow(1,2), 4 \rightarrow(3,1), 5 \rightarrow(2,2), 6 \rightarrow(1,3), 7 \rightarrow(4,1), 8 \rightarrow(3,2), \\
& 9 \rightarrow(2,3), 10 \rightarrow(1,4), 11 \rightarrow(5,1), 12 \rightarrow(4,2), 13 \rightarrow(3,3), 14 \rightarrow(2,4), 15 \rightarrow(1,5), \ldots
\end{aligned}
$$

(The path of points trace out diagonal lines that sweep every lattice point in the coordinate plane.) Since we cover every point, we will eventually hit the submarine.
Remark: The mapping shown above is known as a bijection between the positive integers and ordered pairs of integers $(a, b)$ where $b>0$.


problem: Consider the following two-player game. Player 1 starts with a number, $N$. He then subtracts a proper divisor of $N$ from $N$ and gives the result to player 2 (a proper divisor of $N$ is a positive divisor of $N$ that is not equal to 1 or $N)$. Player 2 does the same thing with the number she gets from player 1 , and gives the result back to player 1. The two players continue until a player is given a prime number or 1 , at which point that player loses. For which values of $N$ does player 1 have a winning strategy?

solution:
All even numbers except for odd powers of 2 . First we show that if you are stuck with an odd number, then you are guaranteed to lose. Suppose you have an odd number $a b$, where $a$ and $b$ are odd numbers, and you choose to subtract $a$. You pass your opponent the number $a(b-1)$. This cannot be a power of 2 (otherwise $a$ is a power of 2 and hence $a=1$, which is not allowed), so your opponent can find an odd proper divisor of $a(b-1)$, and you will have a smaller odd number. Eventually you will get to an odd prime and lose.
Now consider even numbers that aren't powers of 2. As with before, you can find an odd proper divisor of $N$ and pass your opponent an odd number, so you are guaranteed to win.
Finally consider powers of 2 . If you have the number $N=2^{k}$, it would be unwise to choose a proper divisor other than $2^{k-1}$; otherwise you would give your opponent an even number that isn't a power of 2 . Therefore if $k$ is odd, you will end up with 2 and lose. If $k$ is even, though, your opponent will end up with 2 and you will win.
Therefore player 1 has a winning strategy for all even numbers except for odd powers of 2.

solution_match: Answer:


problem:
Call a positive integer in base $10 k$-good if we can split it into two integers y and z , such that y is all digits on the left and z is all digits on the right, and such that $y=k \cdot z$. For example, 2010 is 2 -good because we can split it into 20 and 10 and $20=2 \cdot 10.20010$ is also 2 -good, because we can split it into 20 and 010 . In addition, it is 20 -good, because we can split it into 200 and 10 .
Show that there exists a 48 -good perfect square.

solution: We wish to find integers $a, z$ such that $48 z \cdot 10^{a}+z=z\left(48 \cdot 10^{a}+1\right)$ a perfect square, where $z<10^{a}$. This would prove that there exists a 48 -good perfect square because we are pulling off the last $a$ digits of the number and get two integers $48 z$ and $z$. To make $z$ small by keeping the product a perfect square, we'd like $48 \cdot 10^{a}+1$ to be divisible by some reasonably large square. Take $a=42=\varphi(49)$. By Euler's theorem, $10^{42} \equiv 1(\bmod 49)$, so $48 \cdot 10^{a}+1$ is a multiple of 49 . Then we can take $z=\frac{48 \cdot 10^{a}+1}{49}$. (Clearly $z<10^{a}$, so we're fine.) Then we have $z\left(48 \cdot 10^{a}+1\right)=\left(\frac{48 \cdot 10^{42}+1}{7}\right)^{2}$.


problem:
Let

$$
\begin{gathered}
e^{x}+e^{y}=A \\
x e^{x}+y e^{y}=B \\
x^{2} e^{x}+y^{2} e^{y}=C \\
x^{3} e^{x}+y^{3} e^{y}=D \\
x^{4} e^{x}+y^{4} e^{y}=E .
\end{gathered}
$$

Prove that if $A, B, C$, and $D$ are all rational, then so is $E$.

solution:
We can express $x+y$ in two ways:

$$
\begin{aligned}
& x+y=\frac{A D-B C}{A C-B^{2}} \\
& x+y=\frac{A E-C^{2}}{A D-B C}
\end{aligned}
$$

(We have to be careful if $A C-B^{2}$ or $A D-B C$ is zero. We'll deal with that case later.) It is easy to check that these equations hold by substituting the expressions for $A, B, C, D$, and $E$. Setting these two expressions for $x+y$ equal to each other, we get

$$
\frac{A D-B C}{A C-B^{2}}=\frac{A E-C^{2}}{A D-B C}
$$

which we can easily solve for $E$ as a rational function of $A, B, C$, and $D$. Therefore if $A, B, C$, and $D$ are all rational, then $E$ will be rational as well.
Now, we have to check what happens if $A C-B^{2}=0$ or $A D-B C=0$. If $A C-B^{2}=0$, then writing down the expressions for $A, B$, and $C$ gives us that $(x-y)^{2} e^{x+y}=0$, meaning that $x=y$. If $x=y$, and $x \neq 0, A$ and $D$ are also non-zero, and $\frac{B}{A}=\frac{E}{D}=x$. Since $\frac{B}{A}$ is rational and $D$ is rational, this implies that $E$ is rational. If $x=y=0$, then $E=0$ and so is certainly rational.
We finally must check what happens if $A D-B C=0$. Since $A D-B C=(x+y)\left(A C-B^{2}\right)$, either $A C-B^{2}=0$ (a case we have already dealt with), or $x+y=0$. But if $x+y=0$ then $A E-C^{2}=0$, which implies that $E=\frac{C^{2}}{A}$ (we know that $A \neq 0$ because $e^{x}$ and $e^{y}$ are both positive). Since $A$ and $C$ are rational, this implies that $E$ is also rational.
So, we have shown $E$ to be rational in all cases, as desired.


problem: Show that, for every positive integer $n$, there exists a monic polynomial of degree $n$ with integer coefficients such that the coefficients are decreasing and the roots of the polynomial are all integers.

solution:
We claim we can find values $a$ and $b$ such that $p(x)=(x-a)(x+b)^{n}$ is a polynomial of degree $n+1$ that satisfies these constraints. We show that its coefficients are decreasing by finding a general formula for the coefficient of $x^{k}$.

The coefficient of $x^{k}$ is $b^{k}\binom{n}{k}-a b^{k-1}\binom{n}{k-1}$, which can be seen by expanding out $(x+b)^{n}$ and then multiplying by $(x-a)$. Then we must prove that

$$
b^{k+1}\binom{n}{k+1}-a b^{k}\binom{n}{k}<b^{k}\binom{n}{k}-a b^{k-1}\binom{n}{k-1}
$$

or

$$
a b^{k-1}\left(b\binom{n}{k}-\binom{n}{k-1}\right)>b^{k}\left(b\binom{n}{k+1}-\binom{n}{k}\right) .
$$

Choose $b>\max \left(\frac{\binom{n}{k}}{\binom{n}{k-1}}\right)$ in order to make sure the right-hand term in each product on each side of the inequality sign is positive (we'll be dividing by it, so this makes things much easier), and choose $a>\max \left(\frac{b\left(b\binom{n}{k+1}-\binom{n}{k}\right)}{b\binom{n}{k}-\binom{n}{k-1}}\right)$ to make sure the inequality always holds. Since there are only finite values that $k$ can take on given a fixed $n$ (namely, integers between 0 and $n$ inclusive), we can always find values of $a$ and $b$ that satisfy these constraints.


problem: Let $S$ be a convex set in the plane with a finite area $a$. Prove that either $a=0$ or $S$ is bounded. Note: a set is bounded if it is contained in a circle of finite radius. Note: a set is convex if, whenever two points $A$ and $B$ are in the set, the line segment between them is also in the set.

solution:
If all points in $S$ lie on a straight line, then $a=0$.
Otherwise we may pick three points $A, B$, and $C$ that are not collinear. Let $\omega$ be the incircle of $\triangle A B C$, with $I$ its center and $r$ its radius. Since $S$ is convex, $S$ must contain $\omega$.
![](https://cdn.mathpix.com/cropped/2025_01_24_9c6addbf83a59235d8a9g-3.jpg?height=497&width=703&top_left_y=1237&top_left_x=754)

Suppose $S$ also contains a point $X$ at a distance $d$ from $I$, with $d>R$. We will show that $d \leq \sqrt{r^{2}+\frac{a^{2}}{r^{2}}}$, which implies that the $S$ is bounded since all points are contained within the circle centered at $I$ of radius $\sqrt{r^{2}+\frac{a^{2}}{r^{2}}}$.
Let $Y$ and $Z$ be on $\omega$ such that $\overline{X Y}$ and $\overline{X Z}$ are tangents to $\omega$. Because $S$ is convex, it must contain kite $I Y X Z$, whose area we can compute in terms of $d$ and $r$.
Let $M$ be the midpoint of $\overline{Y Z}$. Since $\triangle I Y X \sim \triangle I M Y$, we know that $\frac{I M}{I Y}=\frac{I Y}{I X}$, that is, $I M=$ $\frac{(I Y)^{2}}{I X}=\frac{r^{2}}{d}$. Then $M Y=\sqrt{r^{2}-\frac{r^{4}}{d^{2}}}=r \sqrt{1-\left(\frac{r}{d}\right)^{2}}=\frac{1}{2} Y Z$.
The area of $I Y X Z$ is $\frac{1}{2}(Y Z)(I X)=r d \sqrt{1-\left(\frac{r}{d}\right)^{2}}=r \sqrt{d^{2}-r^{2}}$. This must be less than or equal to $a$, the area of $S$. This yields $a^{2} \geq r^{2} d^{2}-r^{4}$ or $d^{2} \leq r^{2}+\frac{a^{2}}{r^{2}}$. It follows that $d \leq \sqrt{r^{2}+\frac{a^{2}}{r^{2}}}$, as desired.


problem: Point $P$ lies inside a convex pentagon $A F Q D C$ such that $F P D Q$ is a parallelogram. Given that $\angle F A Q=\angle P A C=10^{\circ}$, and $\angle P F A=\angle P D C=15^{\circ}$. What is $\angle A Q C ?$

solution:
$\frac{\pi}{12}$ Let $C^{\prime}$ be the point such that there is a spiral similarity between $\triangle A F P$ and $\triangle A Q C^{\prime}$. In other words, one triangle can be formed from the other by dilating and rotating about one of the
triangle's vertices (in this case, $A$ ). We will show that $C^{\prime}$ is $C$, so our answer will be $\angle A Q C=$ $\angle A Q C^{\prime}=\angle A F P=15^{\circ}$. By the spiral similarity theorem, $\triangle A F Q \sim \triangle A P C^{\prime}$ (this is intuitive by looking at a diagram), so $\angle P A C=\angle F A Q=10^{\circ}$, so to show that $C^{\prime}$ is $C$, it is sufficient to show that $\angle P D C^{\prime}=15^{\circ}$.
![](https://cdn.mathpix.com/cropped/2025_01_24_9c6addbf83a59235d8a9g-4.jpg?height=441&width=900&top_left_y=449&top_left_x=645)

Let $X$ be the fourth point of the parallelogram $F P C^{\prime} X$ (see the above diagram). The angle between lines $\overline{F P}$ and $\overline{F A}$ is $15^{\circ}$. Since $\overline{X C^{\prime}} \| \overline{F P}$, the angle between $\overline{F A}$ and $\overline{X C^{\prime}}$ is $15^{\circ}$ as well. In addition, the angle between $\overline{Q A}$ and $\overline{Q C^{\prime}}$ is $\angle A Q C^{\prime}=15^{\circ}$, so $\angle X C^{\prime} Q=\angle F A Q$. Further, because $F P C^{\prime} X$ is a parallelogram, $\frac{Q C^{\prime}}{X C^{\prime}}=\frac{Q C^{\prime}}{F P}$. By similar triangles $\triangle A F P$ and $\triangle A Q C^{\prime}, \frac{Q C^{\prime}}{F P}=\frac{Q A}{F A}$. By SAS similarity, there is a spiral similarity between $\triangle X C^{\prime} Q$ and $\triangle F A Q$, so $\angle F Q X=\angle A Q C^{\prime}=15^{\circ}$.
Note that the segments $\overline{F P}, \overline{X C^{\prime}}$, and $\overline{Q D}$ are all parallel and equal in length. Therefore, $\triangle F Q X \cong$ $\triangle P D C^{\prime}$ are congruent, and $\angle P D C^{\prime}=15^{\circ}$ as well. So $C^{\prime}$ is $C$, and $\angle A Q C=15^{\circ}$.


problem:
A knight moves on a two-dimensional grid. From any square, it can move 2 units in one axisparallel direction, then move 1 unit in an orthogonal direction, the way a regular knight moves in a game of chess. The knight starts at the origin. As it moves, it keeps track of a number $t$, which is initially 0 . When the knight lands at the point $(a, b)$, the number is changed from $x$ to $a x+b$.

Show that, for any integers $a$ and $b$, it is possible for the knight to land at the points $(1, a)$ and $(-1, a)$ with $t$ equal to $b$.

solution:
For convenience, we will refer to $(a, b)$ as $[a x+b]$, the function it represents. This will make it easier to follow the trajectory of $t$ over a given sequence of moves.
Suppose we start at $[x+1]$ with $t=a$. Taking the path $[x+1] \rightarrow[-x] \rightarrow[x-1] \rightarrow[-x] \rightarrow[x+1]$ will yield $t=a+2$. So we can go from $t=a$ to $t=a+2$ at $[x+1]$.
We can also move until we get to $[-3]$, then go $[-3] \rightarrow[x-1]$ to end up with $t=-4$ at $[x-1]$. But going $[x-1] \rightarrow[3 x] \rightarrow[x-1]$ means we can go from $t=a$ to $t=3 a-1$ at $x-1$. Since we can start with $t=-4$, this means we can therefore get arbitrarily small even and odd numbers at $[x-1]$, hence also $[3 x]$, hence also at $[x+1]$.
This implies we can get any value of $t$ we want at $[x+1]$, so we can also get any value of $t$ we want at $[-x],[x-1],[-x-2],[x-3]$, etc., as well as $[-x+2],[x+3],[-x+4],[x+5]$, etc. We can do a similar thing starting at $[-x+1]$ to get from $t=a$ to $t=a+2$, and use the $[-x-1] \rightarrow[-3 x] \rightarrow[-x-1]$ loop to get arbitrarily small integers of both parities. So we can get any value of $t$ we want at all points of the form $[ \pm x+k]$ for any integer $k$.


problem: Let $p(x)=a_{n} x^{n}+a_{n-1} x^{n-1}+\ldots+a_{0}$ be a polynomial with complex coefficients such that $a_{i} \neq 0$ for all $i$. Prove that $|r| \leq 2 \max _{i=0}^{n-1}\left|\frac{a_{i-1}}{a_{i}}\right|$ for all roots $r$ of all such polynomials $p$. Here we let $|z|$ denote the absolute value of the complex number $z$.

solution:
If $r$ is a root, then $-a_{n} r^{n}=a_{n-1} r^{n-1}+\ldots+a_{0}$. By the Triangle Inequality, $\left|-a_{n} r^{n}\right| \leq$ $\left|a_{n-1} r^{n-1}\right|+\ldots+\left|a_{0}\right|$. Rearranging this inequality yields $\left|a_{n} r^{n}\right|-\left|a_{n-1} r^{n-1}\right|-\ldots-\left|a_{0}\right| \leq 0$.
Now suppose $|r|=k \max \left|\frac{a_{i-1}}{a_{i}}\right|$. Applying this over values of $i$ ranging from $m+1$ to $n$ (assuming $m+1 \leq n$ ), we get $\left|a_{m} r^{m}\right| \leq \frac{\left|a_{n} r^{n}\right|}{k^{n-m}}$. This, along with the above equation, yields:

$$
\left|a_{n} r^{n}\right| \cdot\left(1-\frac{1}{k}-\frac{1}{k^{2}}-\frac{1}{k^{3}}-\ldots-\frac{1}{k^{n}}\right)=0
$$

This is only true when $a_{n}=0, r=0$, or $\left(1-\frac{1}{k}-\frac{1}{k^{2}}-\ldots\right)=0$. The first option is impossible by the constraints in the problem. The second option implies $k=0$. The third option implies that $k<2$; otherwise ( $1-\frac{1}{k}-\frac{1}{k^{2}}-\ldots-\frac{1}{k^{n}}$ ) would always remain positive. Either way, $|r| \leq 2 \max _{i=0}^{n-1}\left|\frac{a_{i-1}}{a_{i}}\right|$.


problem:
Call an $2 n$-digit base-10 number special if we can split its digits into two sets of size $n$ such that the sum of the numbers in the two sets is the same. Let $p_{n}$ be the probability that a randomly-chosen $2 n$-digit number is special. (We allow leading zeros in $2 n$-digit numbers).
(a) [20] The sequence $p_{n}$ converges to a constant $c$. Find $c$.

solution:
$\frac{1}{2}$ We first claim that if a $2 n$-digit number $x$ has at least eight 0 's and at least eight 1's and the sum of its digits is even, then $x$ is special.
Let $A$ be a set of eight 0 's and eight 1's and let $B$ be the set of all the other digits. We split $b$ arbitrily into two sets $Y$ and $Z$ of equal size. If $\left|\sum_{y \in Y} y-\sum_{z \in Z} z\right|>8$, then we swap the biggest element of the set with the bigger sum with the smallest element of the other set. This transposition always decreases the absolute value of the sum: in the worst case, a 9 from the bigger set is swapped for a 0 from the smaller set, which changes the difference by at most 18 . Therefore, after a finite number of steps, we will have $\left|\sum_{y \in Y} y-\sum_{z \in Z} z\right| \leq 8$.
Note that this absolute value is even, since the sum of all the digits is even. Without loss of generality, suppose that $\sum_{y \in Y} y-\sum_{z \in Z} z$ is $2 k$, where $0 \leq k \leq 4$. If we add $k 0$ 's and $8-k$ 's to $Y$, and we add the other elements of $A$ to $Z$, then the two sets will balance, so $x$ is special.
(b) [45] Let $q_{n}=p_{n}-c$. There exists a unique positive constant $r$ such that $\frac{q_{n}}{r^{n}}$ converges to a constant $d$. Find $r$ and $d$.


solution:
$r=\frac{1}{4}, d=-1$ To get the next asymptotic term after the constant term of $\frac{1}{2}$, we need to consider what happens when the digit sum is even; we want to find the probability that such a number isn't balanced. We claim that the configuration that contributes the vast majority of unbalanced numbers is when all numbers are even and the sum is $2 \bmod 4$, or such a configuration with all numbers increased by 1. Clearly this gives $q_{n}$ being asymptotic to $-\frac{1}{2} \cdot 2 \cdot\left(\frac{1}{2}\right)^{2 n}=-\left(\frac{1}{4}\right)^{n}$, so $r=\frac{1}{4}$ and $d=-1$.
To prove the claim, first note that the asymptotic probability that there are at most 4 digits that occur more than 10 times is asymptotically much smaller than $\left(\frac{1}{2}\right)^{n}$, so we can assume that there exist 5 digits that each occur at least 10 times. If any of those digits are consecutive, then the digit sum being even implies that the number is balanced (by an argument similar to part (a)).
So, we can assume that none of the numbers are consecutive. We would like to say that this implies that the numbers are either $0,2,4,6,8$ or $1,3,5,7,9$. However, we can't quite say this yet, as we need to rule out possibilities like $0,2,4,7,9$. In this case, though, we can just pair 0 and 7 up with 2 and 4 ; by using the same argument as in part (a), except using 0 and 7 both (to get a sum of 7 ) and 2 and 4 both (to get a sum of 6 ) to balance out the two sets at the end.
In general, if there is ever a gap of size 3 , consider the number right after it and the 3 numbers before it (so we have $k-4, k-2, k, k+3$ for some $k$ ), and pair them up such that one pair has a sum that's exactly one more than the other (i.e. pair $k-4$ with $k+3$ and $k-2$ with $k$ ). Since we again have pairs of numbers whose sums differ by 1 , we can use the technique from part (a) of balancing out the sets at the end.
So, we can assume there is no gap of size 3 , which together with the condition that no two numbers are adjacent implies that the 5 digits are either $0,2,4,6,8$ or $1,3,5,7,9$. For the remainder of the solution, we will deal with the $0,2,4,6,8$ case, since it is symmetric with the other case under the transformation $x \mapsto 9-x$.
If we can distribute the odd digits into two sets $S_{1}$ and $S_{2}$ such that (i) the differense in sums of $S_{1}$ and $S_{2}$ is small; and (ii) the difference in sums of $S_{1}$ and $S_{2}$, plus the sum of the even digits, is divisible by 4 , then the same argument as in part (a) implies that the number is good.

In fact, if there are any odd digits, then we can use them at the beginning to fix the parity mod 4 (by adding them all in such that the sums of the two sets remain close, and then potentially switching one with an even digit). Therefore, if there are any odd digits then the number is good.
Also, even if there are no odd digits, if the sum of the digits is divisible by 4 then the number is good.
So, we have shown that almost all non-good numbers come from having all numbers being even with a digit sum that is $2 \bmod 4$, or the analogous case under the mapping $x \mapsto 9-x$. This formalizes the claim we made in the first paragraph, so $r=\frac{1}{4}$ and $d=-1$, as claimed.