# TSTST 2013 Solution Notes
Lincoln, Nebraska
\author{ Evan Chen《陳誼廷》
}
23 April 2024
This is a compilation of solutions for the 2013 TSTST. The ideas of the solution are a mix of my own work, the solutions provided by the competition organizers, and solutions found by the community. However, all the writing is maintained by me.
These notes will tend to be a bit more advanced and terse than the "official" solutions from the organizers. In particular, if a theorem or technique is not known to beginners but is still considered "standard", then I often prefer to use this theory anyways, rather than try to work around or conceal it. For example, in geometry problems I typically use directed angles without further comment, rather than awkwardly work around configuration issues. Similarly, sentences like "let $\mathbb{R}$ denote the set of real numbers" are typically omitted entirely.
Corrections and comments are welcome!
## Contents
0 Problems ..... 2
1 Solutions to Day 1 ..... 4
1.1 TSTST 2013/1 ..... 4
1.2 TSTST 2013/2 ..... 5
1.3 TSTST 2013/3 ..... 6
2 Solutions to Day 2 ..... 8
2.1 TSTST 2013/4 ..... 8
2.2 TSTST 2013/5 ..... 10
2.3 TSTST 2013/6 ..... 11
3 Solutions to Day 3 ..... 13
3.1 TSTST 2013/7 ..... 13
3.2 TSTST 2013/8 ..... 14
3.3 TSTST 2013/9 ..... 15
## §0 Problems
1. Let $A B C$ be a triangle and $D, E, F$ be the midpoints of $\operatorname{arcs} B C, C A, A B$ on the circumcircle. Line $\ell_{a}$ passes through the feet of the perpendiculars from $A$ to $\overline{D B}$ and $\overline{D C}$. Line $m_{a}$ passes through the feet of the perpendiculars from $D$ to $\overline{A B}$ and $\overline{A C}$. Let $A_{1}$ denote the intersection of lines $\ell_{a}$ and $m_{a}$. Define points $B_{1}$ and $C_{1}$ similarly. Prove that triangles $D E F$ and $A_{1} B_{1} C_{1}$ are similar to each other.
2. A finite sequence of integers $a_{1}, a_{2}, \ldots, a_{n}$ is called regular if there exists a real number $x$ satisfying
$$
\lfloor k x\rfloor=a_{k} \quad \text { for } 1 \leq k \leq n
$$
Given a regular sequence $a_{1}, a_{2}, \ldots, a_{n}$, for $1 \leq k \leq n$ we say that the term $a_{k}$ is forced if the following condition is satisfied: the sequence
$$
a_{1}, a_{2}, \ldots, a_{k-1}, b
$$
is regular if and only if $b=a_{k}$.
Find the maximum possible number of forced terms in a regular sequence with 1000 terms.
3. Divide the plane into an infinite square grid by drawing all the lines $x=m$ and $y=n$ for $m, n \in \mathbb{Z}$. Next, if a square's upper-right corner has both coordinates even, color it black; otherwise, color it white (in this way, exactly $1 / 4$ of the squares are black and no two black squares are adjacent). Let $r$ and $s$ be odd integers, and let $(x, y)$ be a point in the interior of any white square such that $r x-s y$ is irrational. Shoot a laser out of this point with slope $r / s$; lasers pass through white squares and reflect off black squares. Prove that the path of this laser will from a closed loop.
4. Circle $\omega$, centered at $X$, is internally tangent to circle $\Omega$, centered at $Y$, at $T$. Let $P$ and $S$ be variable points on $\Omega$ and $\omega$, respectively, such that line $P S$ is tangent to $\omega($ at $S)$. Determine the locus of $O$ - the circumcenter of triangle $P S T$.
5. Let $p$ be a prime. Prove that in a complete graph with $1000 p$ vertices whose edges are labelled with integers, one can find a cycle whose sum of labels is divisible by $p$.
6. Let $\mathbb{N}$ be the set of positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ that satisfy the equation
$$
f^{a b c-a}(a b c)+f^{a b c-b}(a b c)+f^{a b c-c}(a b c)=a+b+c
$$
for all $a, b, c \geq 2$. (Here $f^{k}$ means $f$ applied $k$ times.)
7. A country has $n$ cities, labelled $1,2,3, \ldots, n$. It wants to build exactly $n-1$ roads between certain pairs of cities so that every city is reachable from every other city via some sequence of roads. However, it is not permitted to put roads between pairs of cities that have labels differing by exactly 1 , and it is also not permitted to put a road between cities 1 and $n$. Let $T_{n}$ be the total number of possible ways to build these roads.
(a) For all odd $n$, prove that $T_{n}$ is divisible by $n$.
(b) For all even $n$, prove that $T_{n}$ is divisible by $n / 2$.
8. Define a function $f: \mathbb{N} \rightarrow \mathbb{N}$ by $f(1)=1, f(n+1)=f(n)+2^{f(n)}$ for every positive integer $n$. Prove that $f(1), f(2), \ldots, f\left(3^{2013}\right)$ leave distinct remainders when divided by $3^{2013}$.
9. Let $r$ be a rational number in the interval $[-1,1]$ and let $\theta=\cos ^{-1} r$. Call a subset $S$ of the plane good if $S$ is unchanged upon rotation by $\theta$ around any point of $S$ (in both clockwise and counterclockwise directions). Determine all values of $r$ satisfying the following property: The midpoint of any two points in a good set also lies in the set.
## §1 Solutions to Day 1
## §1.1 TSTST 2013/1
Available online at https://aops.com/community/p3181479.
## Problem statement
Let $A B C$ be a triangle and $D, E, F$ be the midpoints of $\operatorname{arcs} B C, C A, A B$ on the circumcircle. Line $\ell_{a}$ passes through the feet of the perpendiculars from $A$ to $\overline{D B}$ and $\overline{D C}$. Line $m_{a}$ passes through the feet of the perpendiculars from $D$ to $\overline{A B}$ and $\overline{A C}$. Let $A_{1}$ denote the intersection of lines $\ell_{a}$ and $m_{a}$. Define points $B_{1}$ and $C_{1}$ similarly. Prove that triangles $D E F$ and $A_{1} B_{1} C_{1}$ are similar to each other.
In fact, it is true for any points $D, E, F$ on the circumcircle. More strongly we contend:
Claim - Point $A_{1}$ is the midpoint of $\overline{H D}$.
Proof. Lines $m_{a}$ and $\ell_{a}$ are Simson lines, so they both pass through the point $(a+b+$ $c+d) / 2$ in complex coordinates.

Hence $A_{1} B_{1} C_{1}$ is similar to $D E F$ through a homothety at $H$ with ratio $\frac{1}{2}$.
## §1.2 TSTST 2013/2
Available online at https://aops.com/community/p3181480.
## Problem statement
A finite sequence of integers $a_{1}, a_{2}, \ldots, a_{n}$ is called regular if there exists a real number $x$ satisfying
$$
\lfloor k x\rfloor=a_{k} \quad \text { for } 1 \leq k \leq n .
$$
Given a regular sequence $a_{1}, a_{2}, \ldots, a_{n}$, for $1 \leq k \leq n$ we say that the term $a_{k}$ is forced if the following condition is satisfied: the sequence
$$
a_{1}, a_{2}, \ldots, a_{k-1}, b
$$
is regular if and only if $b=a_{k}$.
Find the maximum possible number of forced terms in a regular sequence with 1000 terms.
The answer is 985 . WLOG, by shifting $a_{1}=0$ (clearly $a_{1}$ isn't forced). Now, we construct regular sequences inductively using the following procedure. Start with the inequality
$$
\frac{0}{1} \leq x<\frac{1}{1}
$$
Then for each $k=2,3, \ldots, 1000$ we perform the following procedure. If there is no fraction of the form $F=\frac{m}{k}$ in the interval $A \leq xq>\max \{a, b\}$ be primes. Suppose $s=a^{p} b^{q}$ and $t=s^{2}$; then
$$
p g_{t}(a)+q g_{t}(b)=g_{t}\left(a^{p} b^{q}\right)=g_{t}(s)=f^{s^{2}-s}(s)-s=0
$$
Now
$$
q \mid g_{t}(a)>-a \quad \text { and } \quad p \mid g_{t}(b)>-b \Longrightarrow g_{t}(a)=g_{t}(b)=0
$$
and so we conclude $f^{t-a}(t)=a$ and $f^{t-b}(t)=b$ for $a, b \geq 2$.
In particular, if $a=n$ and $b=n+1$ then we deduce $f(n+1)=n$ for all $n \geq 2$, as desired.
Remark. If you let $c=(a b)^{2}$ after the first lemma, you recover the 2-variable version!
## §3 Solutions to Day 3
## §3.1 TSTST 2013/7
Available online at https://aops.com/community/p3181485.
## Problem statement
A country has $n$ cities, labelled $1,2,3, \ldots, n$. It wants to build exactly $n-1$ roads between certain pairs of cities so that every city is reachable from every other city via some sequence of roads. However, it is not permitted to put roads between pairs of cities that have labels differing by exactly 1 , and it is also not permitted to put a road between cities 1 and $n$. Let $T_{n}$ be the total number of possible ways to build these roads.
(a) For all odd $n$, prove that $T_{n}$ is divisible by $n$.
(b) For all even $n$, prove that $T_{n}$ is divisible by $n / 2$.
You can just spin the tree!
Fixing $n$, the group $G=\mathbb{Z} / n \mathbb{Z}$ acts on the set of trees by rotation (where we imagine placing $1,2, \ldots, n$ along a circle).
Claim - For odd $n$, all trees have trivial stabilizer.
Proof. One way to see this is to look at the degree sequence. Suppose $g^{e}$ fixes a tree $T$. Then so does $g^{k}$, for $k=\operatorname{gcd}(e, n)$. Then it follows that $n / k$ divides $\sum_{v} \operatorname{deg} v=2 n-2$. Since $\operatorname{gcd}(2 n-2, n)=1$ we must then have $k=n$.
The proof for even $n$ is identical except that $\operatorname{gcd}(2 n-2, n)=2$ and hence each tree either has stabilizer with size $\leq 2$.
There is also a proof using linear algebra, using Kirchoff's tree formula. (Overkill.)
## §3.2 TSTST 2013/8
Available online at https://aops.com/community/p3181486.
## Problem statement
Define a function $f: \mathbb{N} \rightarrow \mathbb{N}$ by $f(1)=1, f(n+1)=f(n)+2^{f(n)}$ for every positive integer $n$. Prove that $f(1), f(2), \ldots, f\left(3^{2013}\right)$ leave distinct remainders when divided by $3^{2013}$.
I'll prove by induction on $k \geq 1$ that any $3^{k}$ consecutive values of $f$ produce distinct residues modulo $3^{k}$. The base case $k=1$ is easily checked ( $f$ is always odd, hence $f$ cycles $1,0,2 \bmod 3)$.
For the inductive step, assume it's true up to $k$. Since $2^{\bullet}\left(\bmod 3^{k+1}\right)$ cycles every $2 \cdot 3^{k}$, and $f$ is always odd, it follows that
$$
\begin{aligned}
f\left(n+3^{k}\right)-f(n) & =2^{f(n)}+2^{f(n+1)}+\cdots+2^{f\left(n+3^{k}-1\right)} \quad\left(\bmod 3^{k+1}\right) \\
& \equiv 2^{1}+2^{3}+\cdots+2^{2 \cdot 3^{k}-1} \quad\left(\bmod 3^{k+1}\right) \\
& =2 \cdot \frac{4^{3^{k}}-1}{4-1}
\end{aligned}
$$
Hence
$$
f\left(n+3^{k}\right)-f(n) \equiv C \quad\left(\bmod 3^{k+1}\right) \quad \text { where } \quad C=2 \cdot \frac{4^{3^{k}}-1}{4-1}
$$
noting that $C$ does not depend on $n$. Exponent lifting gives $\nu_{3}(C)=k$ hence $f(n)$, $f\left(n+3^{k}\right), f\left(n+2 \cdot 3^{k}\right)$ differ mod $3^{k+1}$ for all $n$, and the inductive hypothesis now solves the problem.
## §3.3 TSTST 2013/9
Available online at https://aops.com/community/p3181487.
## Problem statement
Let $r$ be a rational number in the interval $[-1,1]$ and let $\theta=\cos ^{-1} r$. Call a subset $S$ of the plane good if $S$ is unchanged upon rotation by $\theta$ around any point of $S$ (in both clockwise and counterclockwise directions). Determine all values of $r$ satisfying the following property: The midpoint of any two points in a good set also lies in the set.
The answer is that $r$ has this property if and only if $r=\frac{4 n-1}{4 n}$ for some integer $n$.
Throughout the solution, we will let $r=\frac{a}{b}$ with $b>0$ and $\operatorname{gcd}(a, b)=1$. We also let
$$
\omega=e^{i \theta}=\frac{a}{b} \pm \frac{\sqrt{b^{2}-a^{2}}}{b} i
$$
This means we may work with complex multiplication in the usual way; the rotation of $z$ through center $c$ is given by $z \mapsto \omega(z-c)+c$.
For most of our proof, we start by constructing a good set as follows.
- Start by letting $S_{0}=\{0,1\}$.
- Let $S_{i}$ consist of $S_{i-1}$ plus all points that can be obtained by rotating a point of $S_{i-1}$ through a different point of $S_{i-1}$ (with scale factor $\omega$ ).
- Let $S_{\infty}=\bigcup_{i \geq 0} S_{i}$.
The set $S_{\infty}$ is the (minimal, by inclusion) good set containing 0 and 1 . We are going to show that for most values of $r$, we have $\frac{1}{2} \notin S_{\infty}$.
Claim - If $b$ is odd, then $\frac{1}{2} \notin S_{\infty}$.
Proof. Idea: denominators that appear are always odd.
Consider the ring
$$
A=\mathbb{Z}_{\{b\}}=\left\{\frac{s}{t}|s, t \in \mathbb{Z}, t| b^{\infty}\right\}
$$
which consists of all rational numbers whose denominators divide $b^{\infty}$. Then, $0,1, \omega \in$ $A\left[\sqrt{b^{2}-a^{2}}\right]$ and hence $S_{\infty} \subseteq A\left[\sqrt{b^{2}-a^{2}}\right]$ too. (This works even if $\sqrt{b^{2}-a^{2}} \in \mathbb{Z}$, in which case $S_{\infty} \subseteq A=A\left[\sqrt{b^{2}-a^{2}}\right]$.)
But $\frac{1}{2} \notin A\left[\sqrt{b^{2}-a^{2}}\right]$.
Claim - If $b$ is even and $|b-a| \neq 1$, then $\frac{1}{2} \notin S_{\infty}$.
Proof. Idea: take modulo a prime dividing $b-a$.
Let $D=b^{2}-a^{2} \equiv 3(\bmod 4)$. Let $p$ be a prime divisor of $b-a$. Because $\operatorname{gcd}(a, b)=1$, we have $p \neq 2$ and $p \nmid b$.
Consider the ring
$$
A=\mathbb{Z}_{(p)}=\left\{\left.\frac{s}{t} \right\rvert\, s, t \in \mathbb{Z}, p \perp t\right\}
$$
which consists of all rational numbers whose denominators are coprime to $p$. Then, $0,1, \omega \in A[\sqrt{-D}]$ and hence $S_{\infty} \subseteq A[\sqrt{-D}]$ too.
Now, there is a well-defined "mod- $p$ " ring homomorphism
$$
\Psi: A[\sqrt{-D}] \rightarrow \mathbb{F}_{p} \quad \text { by } \quad x+y \sqrt{-D} \mapsto x \bmod p
$$
which commutes with addition and multiplication (as $p \mid D$ ). Under this map,
$$
\omega \mapsto \frac{a}{b} \bmod p=1
$$
Consequently, the rotation $z \mapsto \omega(z-c)+c$ is just the identity map modulo $p$. In other words, the pre-image of any point in $S_{\infty}$ under $\Psi$ must be either $\Psi(0)=0$ or $\Psi(1)=1$.
However, $\Psi(1 / 2)=1 / 2$ is neither of these. So this point cannot be achieved.
Claim - Suppose $a=2 n-1$ and $b=2 n$ for $n$ an odd integer. Then $\frac{1}{2} \notin S_{\infty}$
Proof. Idea: $\omega$ is "algebraic integer" sans odd denominators.
This time, we define the ring
$$
B=\mathbb{Z}_{(2)}=\left\{\left.\frac{s}{t} \right\rvert\, s, t \in \mathbb{Z}, t \text { odd }\right\}
$$
of rational numbers with odd denominator. We carefully consider the ring $B[\omega]$ where
$$
\omega=\frac{2 n-1 \pm \sqrt{1-4 n}}{2 n}
$$
So $S_{\infty} \subseteq B[\omega]$ as $0,1, \omega \in B[\omega]$.
I claim that $B[\omega]$ is an integral extension of $B$; equivalently that $\omega$ is integral over $B$. Indeed, $\omega$ is the root of the monic polynomial
$$
(T-1)^{2}+\frac{1}{n}(T-1)-\frac{1}{n}=0
$$
where $\frac{1}{n} \in B$ makes sense as $n$ is odd.
On the other hand, $\frac{1}{2}$ is not integral over $B$ so it is not an element of $B[\omega]$.
It remains to show that if $r=\frac{4 n-1}{4 n}$, then goods sets satisfy the midpoint property. Again starting from the points $z_{0}=0, z_{1}=1$ construct the sequence
$$
\begin{aligned}
z_{2} & =\omega\left(z_{1}-z_{0}\right)+z_{0} \\
z_{3} & =\omega^{-1}\left(z_{0}-z_{2}\right)+z_{2} \\
z_{4} & =\omega^{-1}\left(z_{2}-z_{3}\right)+z_{3} \\
z_{5} & =\omega\left(z_{3}-z_{4}\right)+z_{4}
\end{aligned}
$$
as shown in the diagram below.

This construction shows that if we have the length-one segment $\{0,1\}$ then we can construct the length-one segment $\{2 r-2,2 r-1\}$. In other words, we can shift the segment to the left by
$$
1-(2 r-1)=2(1-r)=\frac{1}{2 n}
$$
Repeating this construction $n$ times gives the desired midpoint $\frac{1}{2}$.