\documentclass[11pt]{scrartcl}
\usepackage{evan}

\begin{document}
\title{IMO 1982/1}
\subtitle{Evan Chen}
\author{Twitch Solves ISL}
\date{Episode 37}
\maketitle

\section*{Problem}
The function $f \colon \ZZ_{>0} \to \ZZ_{\ge 0}$
satisfies $f(2)=0$, $f(3)>0$, $f(9999)=3333$ and
\[ f(m+n) - f(m) - f(n) \in \{0,1\}
  \qquad \text{for all } m,n > 0. \]
Calculate $f(1982)$.

\section*{Video}
\href{https://www.youtube.com/watch?v=ls0fTee5eT0&list=PLi6h8GM1FA6yHh4gDk_ZYezmncU1EJUmZ}{\texttt{https://youtu.be/ls0fTee5eT0}}

\section*{External Link}
\url{https://aops.com/community/p366626}

\newpage

\section*{Solution}
Answer: $f(1982) = 660$ only.

We start with a few easy observations:
\begin{itemize}
  \ii Since $f(2)-2f(1) = -2f(1) \in \{0,1\}$
  it follows $\boxed{f(1)=0}$.
  \ii Since $f(3)-f(1)-f(2) = f(3) \in \{0,1\}$
  it follows $\boxed{f(3) = 1}$.
\end{itemize}
Now, we have the following general claim.
\begin{claim*}
  We must have $f(n+3) \ge f(n)+1$.
  Hence, by induction, $f(3k) \ge k$ for every $k \ge 0$.
\end{claim*}
\begin{proof}
  \[ 0 \le f(n+3) - f(n) - f(3) = f(n+3) - (f(n)+1). \qedhere \]
\end{proof}
However, since $f(9999) = 3333$ exactly,
it follows that equality must hold in the claim up until then.
In other words, we have that $f(3k) = k$ for each $k \ge 0$.

To finish, use the following calculation:
\begin{align*}
  3333 = f(9999) &\ge 3f(1982) + f(4053) = 3f(1982) + 1351 \\
  \implies f(1982) &\le \frac{1982}{3} \\
  \text{but also } f(1982) &\ge f(1980) + f(2) = 660 + 0 = 660.
\end{align*}
This implies $f(1982) = 660$.

\end{document}
