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

\begin{document}
\title{Iberoamerican 2021/5}
\subtitle{Evan Chen}
\author{Twitch Solves ISL}
\date{Episode 87}
\maketitle

\section*{Problem}
For a finite set $C$ of integer numbers,
we define $S(C)$ as the sum of the elements of $C$.
Find two non-empty sets $A$ and $B$ whose intersection is empty,
whose union is the set $\{1,2,\dots, 2021\}$
and such that the product $S(A)S(B)$ is a perfect square.

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

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

\newpage

\section*{Solution}
Use
\begin{align*}
    B &= \left\{ 1, 2, 3, \dots, 243, 1778, 1779, \dots 2020 \right\} \\
    A &= \left\{ \text{everything else} \right\}. \\
    S(B) &= 9^2 \cdot 6063 = 243 \cdot 2021 \\
    S(A) &= 16^2 \cdot 6063 = 768 \cdot 2021.
\end{align*}
Here we were motivated by the deep fact that
\[ S(A) + S(B) = 1 + 2 + \dots + 2021 = 1011 \cdot 2021 \]
with $337 = 9^2+16^2$ being the only $1 \bmod 4$
prime factor in the right hand side.

\begin{remark*}
  One can show that in fact $S(A)$ and $S(B)$
  must be equal to $9^2 \cdot 6063$
  and $16^2 \cdot 6063$ via Fermat's Christmas theorem.
\end{remark*}

\end{document}
