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

\begin{document}
\title{IMO 1981/3}
\subtitle{Evan Chen}
\author{Twitch Solves ISL}
\date{Episode 28}
\maketitle

\section*{Problem}
Determine the maximum possible value of $m^2+n^2$
where $m$ and $n$ are integers in $\{1,2,\dots,1981\}$
satisfying $(n^2-mn-m^2)^2=1$.

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

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

\newpage

\section*{Solution}
We start by just applying the quadratic formula.
Write
\[ n^2 - mn - m^2 = \pm 1 \qquad n = \frac{m \pm \sqrt{5m^2 \pm 4}}{2} \]
Hence for any given $m$ there is a valid $n$ iff $5m^2 \pm 4$ is a square.

It turns out that:
\begin{claim*}
  A positive integer $m$ is a Fibonacci number
  if and only if at least one of $5m^2-4$ and $5m^2+4$ is a perfect square.
\end{claim*}
You're welcome.

A quick calculation then gives $(m,n) = (987,1597)$
so the optimal value is $987^2 + 1597^2$.

\begin{remark*}
  If you don't know this claim about Fibonacci numbers,
  you would end up finding it by solving the resulting Pell equation.
  So while it's funny that it turns out $5m^2 \pm 4 = t^2$ gives
  exactly the Fibonacci numbers for $m$,
  the solution doesn't really depend on this and would work with other numbers too.
\end{remark*}

\end{document}
