% A sample Beamer presentation for young researchers (Felix Gotti, MIT PRIMES).
% For the version you post online, add "trans" to the class options:
%   \documentclass[trans,aspectratio=169]{beamer}
% The trans option ignores \pause and makes the slides easier to read.
\documentclass[aspectratio=169]{beamer}

\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{tikz}
\usetikzlibrary{positioning}

% ---- Look: MIT colors, no navigation bar, numbered slides ----------------
\definecolor{mitred}{HTML}{750014}
\definecolor{mitsilver}{HTML}{8B959E}
\setbeamercolor{structure}{fg=mitred}
\setbeamercolor{alerted text}{fg=mitred}
\setbeamercolor{block title}{fg=white,bg=mitred}
\setbeamercolor{block body}{bg=mitred!6}
\setbeamercolor{block title example}{fg=black,bg=mitsilver!55}
\setbeamercolor{block body example}{bg=mitsilver!14}
\setbeamertemplate{blocks}[rounded][shadow=false]
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{itemize items}[circle]

\newcommand{\nn}{\mathbb{N}}
\newcommand{\B}{\mathcal{B}}

% ---- Title page: all authors (alphabetical), mentor, conference, date ----
\title{A Transfiguration Theorem:\\ Trading Boxes of Every Flavour Beans}
\author[Granger, Potter, and Weasley]{Hermione Granger, Harry Potter, and Ronald Weasley\\[3pt]
  {\small Mentor: Prof.\ Remus Lupin}}
\institute{Gryffindor Program\\ Hogwarts School of Witchcraft and Wizardry}
\date{\alert{Fall-Term Gryffindor Conference}\\ October 17, 2026}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

% ---- Start with the question, not with a definition ----------------------
\begin{frame}{The Question: Exactly $n$ Beans, Please!}
  After Prof.\ Lupin drove a dementor out of our compartment on the Hogwarts
  Express with \emph{Expecto Patronum}, Ron wanted beans, not chocolate.
  The trolley sells Bertie Bott's Every Flavour Beans only in boxes of
  $6$, $9$, and $20$ beans.

  \begin{center}
  \begin{tikzpicture}[box/.style={draw=mitred,thick,fill=mitsilver!25,rounded corners=2pt}]
    \draw[box] (0,0) rectangle (1.2,0.9);   \node at (0.6,0.45) {\large $6$};
    \draw[box] (2.0,0) rectangle (3.5,1.1); \node at (2.75,0.55) {\large $9$};
    \draw[box] (4.3,0) rectangle (6.5,1.4); \node at (5.4,0.7) {\large $20$};
  \end{tikzpicture}
  \end{center}

  \begin{enumerate}
    \item Which numbers of beans can Ron buy exactly?
    \item In how many ways can he buy them?
    \item How are the different ways related to each other?
  \end{enumerate}
\end{frame}

% ---- Notation, and an example right after each definition ----------------
\begin{frame}{Notation and First Definitions}
  We write $\nn_0 := \{0, 1, 2, \ldots\}$.

  \medskip
  The \alert{Bertie Bott monoid} is the set of numbers of beans Ron can buy:
  \[
    \B := \{\, 6a + 9b + 20c : a, b, c \in \nn_0 \,\}.
  \]
  \vspace{-1.2em}
  \begin{example}
    The number $44 = 6 + 2 \cdot 9 + 20$ belongs to $\B$, but $43$ does not.
  \end{example}

  A \alert{factorization} of $n \in \B$ is a triple $(a,b,c) \in \nn_0^3$ with
  $6a + 9b + 20c = n$, that is, a way to buy exactly $n$ beans. Its
  \alert{length} is $a + b + c$, the number of boxes.
  \begin{example}
    The factorizations of $44$ are $(1,2,1)$ and $(4,0,1)$, of lengths $4$ and $5$.
  \end{example}
\end{frame}

% ---- A picture is worth a thousand words ----------------------------------
\begin{frame}{Accio Beans! Which Numbers Can Ron Buy?}
  \begin{columns}[T]
    \begin{column}{0.53\textwidth}
      \centering
      \begin{tikzpicture}[x=0.66cm,y=0.62cm,
          yes/.style={draw=mitred!60,fill=mitred!14,minimum size=0.56cm,inner sep=0pt,font=\scriptsize},
          no/.style={draw=gray!40,text=gray!60,minimum size=0.56cm,inner sep=0pt,font=\scriptsize}]
        \foreach \n in {0,6,9,12,15,18,20,21,24,26,27,29,30,32,33,35,36,38,39,40,41,42,44,45,46,47,48,49}
          \node[yes] at ({mod(\n,10)},{-floor(\n/10)}) {\n};
        \foreach \n in {1,2,3,4,5,7,8,10,11,13,14,16,17,19,22,23,25,28,31,34,37}
          \node[no] at ({mod(\n,10)},{-floor(\n/10)}) {\n};
        \node[no,draw=mitred,very thick,text=mitred] at (3,-4) {\textbf{43}};
      \end{tikzpicture}

      \smallskip
      {\scriptsize Shaded: Ron can buy it. White: he cannot.}
    \end{column}
    \begin{column}{0.45\textwidth}
      Since $44, 45, \ldots, 49$ are in $\B$, adding boxes of $6$ gives every
      number from $44$ on.

      \medskip
      The \alert{Frobenius number} of $\B$ is the largest number not in $\B$.
      \begin{example}
        The Frobenius number of $\B$ is $43$.
      \end{example}

      With only two box sizes $p$ and $q$, where $\gcd(p,q) = 1$, the
      Frobenius number is $pq - p - q$ (Sylvester, 1884). For boxes of $9$
      and $20$, it is $151$.
    \end{column}
  \end{columns}
\end{frame}

% ---- Tables organize examples ----------------------------------------------
\begin{frame}{Many Ways to Buy the Same Beans}
  The \alert{length set} of $n \in \B$ is the set $L(n)$ of lengths of all
  factorizations of $n$.

  \begin{center}
  \renewcommand{\arraystretch}{1.15}
  \begin{tabular}{rll}
    \toprule
    $n$ & factorizations $(a,b,c)$ & $L(n)$ \\
    \midrule
    $18$ & $(3,0,0),\ (0,2,0)$ & $\{2,3\}$ \\
    $36$ & $(6,0,0),\ (3,2,0),\ (0,4,0)$ & $\{4,5,6\}$ \\
    $44$ & $(4,0,1),\ (1,2,1)$ & $\{4,5\}$ \\
    $60$ & $(10,0,0),\ (7,2,0),\ (4,4,0),\ (1,6,0),\ (0,0,3)$ & $\{3,7,8,9,10\}$ \\
    \bottomrule
  \end{tabular}
  \end{center}

  \begin{example}
    The length set of $60$ is $L(60) = \{3,7,8,9,10\}$: Hermione buys $60$
    beans in $3$ boxes, while Ron, who likes opening boxes, buys them in $10$.
  \end{example}
\end{frame}

% ---- The main result: give it a name, not a number -----------------------
\begin{frame}{Our Main Result: Two Spells Are Enough}
  Consider the following two \alert{transfiguration spells}:
  \begin{itemize}
    \item[$\tau_1$:] three boxes of $6$ $\longleftrightarrow$ two boxes of $9$ \quad (both hold $18$ beans),
    \item[$\tau_2$:] three boxes of $20$ $\longleftrightarrow$ ten boxes of $6$ \quad (both hold $60$ beans).
  \end{itemize}

  \begin{theorem}[Granger, Potter, and Weasley, 2026]
    Any two ways of buying the same number of beans can be transfigured
    into each other using only $\tau_1$ and $\tau_2$.
  \end{theorem}

  \begin{example}
    \centering
    \begin{tikzpicture}[f/.style={draw=mitred,fill=white,rounded corners=2pt,inner sep=3pt,font=\small},
                        ->,>=stealth,thick,node distance=1.05cm]
      \node[f] (z1) {$(0,0,3)$};
      \node[f,right=of z1] (z2) {$(10,0,0)$};
      \node[f,right=of z2] (z3) {$(7,2,0)$};
      \node[f,right=of z3] (z4) {$(4,4,0)$};
      \node[f,right=of z4] (z5) {$(1,6,0)$};
      \draw (z1) -- node[above,font=\scriptsize] {$\tau_2$} (z2);
      \draw (z2) -- node[above,font=\scriptsize] {$\tau_1$} (z3);
      \draw (z3) -- node[above,font=\scriptsize] {$\tau_1$} (z4);
      \draw (z4) -- node[above,font=\scriptsize] {$\tau_1$} (z5);
    \end{tikzpicture}

    \smallskip
    All five factorizations of $60$ are connected by our two spells.
  \end{example}
\end{frame}

% ---- A proof only if it is short and teaches something --------------------
\begin{frame}{Why Two Spells Are Enough: The Idea of the Proof}
  \begin{block}{Recall}
    A factorization $(a,b,c)$ of $n$ is a way to buy exactly $n$ beans,
    that is, $6a + 9b + 20c = n$.
  \end{block}

  Take two factorizations $(a,b,c)$ and $(a',b',c')$ of the same $n$.
  \begin{enumerate}
    \item Since $6a + 9b + 20c \equiv 2c \pmod 3$, we get $c \equiv c' \pmod 3$.
      Use $\tau_2$ on the one with more boxes of $20$ until $c = c'$.
      \pause
    \item Now $6a + 9b = 6a' + 9b'$, and reducing modulo $6$ gives
      $b \equiv b' \pmod 2$. Use $\tau_1$ until $b = b'$.
      \pause
    \item Then $6a = 6a'$, so $a = a'$: the two factorizations are the same.
  \end{enumerate}
\end{frame}

% ---- Recall what the audience needs: they cannot turn back -----------------
\begin{frame}{Neither Spell Can Be Dropped}
  \begin{itemize}
    \item The only ways to buy $18$ beans are $(3,0,0)$ and $(0,2,0)$, and
      only $\tau_1$ connects them.
    \item The way $(0,0,3)$ of buying $60$ beans shares no box with the other
      four ways, and only $\tau_2$ reaches it.
  \end{itemize}

  \medskip
  A set of spells is a \alert{minimal presentation} of $\B$ if it connects
  any two factorizations of the same number and none of its spells can be
  dropped (Rosales and Garc\'{\i}a-S\'anchez, 2009).
  \begin{example}
    By our main result and the two observations above, $\{\tau_1, \tau_2\}$ is
    a minimal presentation of $\B$.
  \end{example}
\end{frame}

% ---- Finish by answering the questions you asked at the beginning ---------
\begin{frame}{Back to Ron's Three Questions}
  \begin{enumerate}
    \item \textbf{Which numbers of beans can Ron buy exactly?}\\
      All of them except $22$ numbers, and the largest one he cannot buy is $43$.
    \item \textbf{In how many ways can he buy them?}\\
      Some in only one way, like $20$; others in many ways, like $60$, which he
      can buy in five ways, using from $3$ to $10$ boxes.
    \item \textbf{How are the different ways related to each other?}\\
      Our two spells, $\tau_1$ and $\tau_2$, connect any two of them.
  \end{enumerate}

  \begin{exampleblock}{Hermione's Challenge for You}
    If the trolley also sold boxes of $7$ beans, what would be the largest
    number of beans that Ron could not buy?
    % Answer for the curious reader of this source: 17.
  \end{exampleblock}
\end{frame}

% ---- Thank the people who made the research possible -----------------------
\begin{frame}{Acknowledgments}
  \begin{itemize}
    \item We are grateful to our mentor, Prof.\ Remus Lupin, for his guidance
      throughout this project (and for the chocolate).
    \item We thank Prof.\ Minerva McGonagall for teaching us Transfiguration
      and for comments that improved our main result.
    \item We thank Rubeus Hagrid and Buckbeak the Hippogriff for testing
      every flavour, and Hedwig for delivering our drafts on time.
    \item Finally, we thank the organizers of the Gryffindor Program for making
      this magical research opportunity possible.
  \end{itemize}
\end{frame}

% ---- Only the main references, as further reading --------------------------
\begin{frame}{References}
  \begin{itemize}
    \item A. Dumbledore, \emph{A Transfiguration Primer: From Matchsticks to
      Every Flavour Beans}, Obscurus Books, London, 1962.
    \item M. McGonagall, \emph{Transfiguring boxes of sweets},
      Transfiguration Today \textbf{77} (1993) 1--19.
    \item J. L. Ram\'{\i}rez Alfons\'{\i}n, \emph{The Diophantine Frobenius
      Problem}, Oxford University Press, 2005.
    \item J. C. Rosales and P. A. Garc\'{\i}a-S\'anchez, \emph{Numerical
      Semigroups}, Developments in Mathematics, Vol.~20, Springer, 2009.
  \end{itemize}
\end{frame}

% ---- Thank your audience: they gave you their time and attention ----------
% The picture is drawn with TikZ, so the file needs no image files.
\definecolor{nightsky}{HTML}{070B1F}
\definecolor{dusk}{HTML}{1C1F4A}
\definecolor{horizon}{HTML}{5E1426}
\definecolor{hills}{HTML}{150E26}
\definecolor{castle}{HTML}{0B0714}
\definecolor{stone}{HTML}{3A2E52}
\definecolor{lakeTop}{HTML}{121638}
\definecolor{lakeBottom}{HTML}{04050D}
\definecolor{windowgold}{HTML}{FFC857}
\definecolor{moon}{HTML}{FFF4D6}
\begin{frame}[plain]
  \begin{tikzpicture}[remember picture, overlay]
    \begin{scope}[shift={(current page.south west)}, x=1cm, y=1cm]
      % Night sky with stars and the moon
      \shade[top color=nightsky, middle color=dusk, bottom color=horizon] (0,0) rectangle (16,9);
      \pgfmathsetseed{2026}
      \foreach \i in {1,...,140} {
        \pgfmathsetmacro{\sx}{16*rnd}
        \pgfmathsetmacro{\sy}{3.6+5.4*rnd}
        \pgfmathsetmacro{\sr}{0.006+0.018*rnd}
        \pgfmathsetmacro{\so}{0.35+0.65*rnd}
        \fill[white, opacity=\so] (\sx,\sy) circle (\sr);
      }
      \shade[inner color=white, outer color=dusk, opacity=0.35] (2.4,7.3) circle (1.1);
      \fill[moon] (2.4,7.3) circle (0.5);
      \fill[moon!75!gray, opacity=0.5] (2.25,7.42) circle (0.08) (2.56,7.16) circle (0.06) (2.45,7.55) circle (0.04);

      % Hills and the lake
      \fill[hills] (0,1.1) -- (0,2.5) .. controls (2.5,3.1) and (4.5,2.3) .. (7,2.7)
        .. controls (9.5,3.1) and (10.5,3.0) .. (12.5,3.1) .. controls (14,3.2) and (15,2.8) .. (16,2.9)
        -- (16,1.1) -- cycle;
      \shade[top color=lakeTop, bottom color=lakeBottom] (0,0) rectangle (16,1.15);
      \foreach \i/\w in {0/0.5, 1/0.36, 2/0.26, 3/0.18}
        \fill[moon, opacity=0.25] (2.4-\w,0.95-0.22*\i) rectangle (2.4+\w,0.99-0.22*\i);
      \foreach \x in {11.3, 12.15, 13.0, 13.75, 14.45}
        \fill[windowgold, opacity=0.25] (\x,0.85) rectangle (\x+0.06,1.05);

      % Hogwarts castle with lit windows
      \fill[castle] (11.0,2.9) rectangle (14.8,3.9);
      \foreach \x in {11.0,11.3,...,14.6}
        \fill[castle] (\x,3.9) rectangle (\x+0.15,4.05);
      \foreach \x/\w/\h/\r in {11.15/0.36/5.1/0.8, 11.95/0.46/5.9/1.0, 12.85/0.40/5.3/0.85,
                               13.55/0.52/6.3/1.15, 14.35/0.32/4.8/0.7} {
        \fill[castle] (\x,2.9) rectangle (\x+\w,\h);
        \fill[castle] (\x-0.07,\h) -- (\x+\w/2,\h+\r) -- (\x+\w+0.07,\h) -- cycle;
      }
      \foreach \x/\y in {11.25/4.4, 11.25/3.4, 12.08/5.0, 12.08/4.2, 12.95/4.6, 13.68/5.6,
                         13.68/4.8, 13.68/3.6, 14.42/4.0, 11.6/3.3, 12.5/3.3, 13.1/3.3, 14.0/3.3} {
        \fill[windowgold, opacity=0.3] (\x+0.045,\y+0.085) circle (0.12);
        \fill[windowgold] (\x,\y) rectangle (\x+0.09,\y+0.17);
      }

      % The viaduct and the Hogwarts Express
      \fill[stone] (-0.1,2.12) rectangle (9.6,2.3);
      \foreach \i in {0,...,10} {
        \pgfmathsetmacro{\x}{0.85*\i}
        \fill[stone] (\x,1.15) rectangle (\x+0.14,2.12);
        \draw[stone, line width=2.2pt] (\x+0.14,1.82) arc (180:0:0.355);
      }
      \fill[stone] (9.35,1.15) rectangle (9.49,2.12);
      \foreach \x in {0.6, 2.05, 3.5} {
        \fill[mitred] (\x,2.34) rectangle (\x+1.35,2.86);
        \fill[mitred!60!black] (\x-0.02,2.86) rectangle (\x+1.37,2.92);
        \foreach \k in {0,...,4}
          \fill[windowgold] (\x+0.12+0.25*\k,2.55) rectangle (\x+0.27+0.25*\k,2.75);
        \fill[black] (\x+0.25,2.34) circle (0.07) (\x+1.1,2.34) circle (0.07);
      }
      \fill[black!80] (4.95,2.34) rectangle (5.5,2.72);
      \fill[mitred!80!black] (5.55,2.34) rectangle (6.05,3.05);
      \fill[black!85] (5.5,3.05) rectangle (6.1,3.12);
      \fill[windowgold] (5.68,2.72) rectangle (5.92,2.92);
      \fill[mitred] (6.05,2.34) rectangle (7.0,2.82);
      \fill[black!85] (7.0,2.36) rectangle (7.12,2.8);
      \fill[black!85] (6.75,2.82) rectangle (6.92,3.12) (6.7,3.12) rectangle (6.97,3.18);
      \fill[black!85] (7.12,2.34) -- (7.3,2.34) -- (7.12,2.5) -- cycle;
      \fill[black] (6.3,2.36) circle (0.11) (6.7,2.36) circle (0.11) (5.8,2.36) circle (0.08);
      \foreach \x/\y/\r/\o in {6.75/3.45/0.16/0.7, 6.45/3.7/0.22/0.6, 6.05/3.95/0.28/0.5,
                               5.5/4.15/0.34/0.4, 4.85/4.3/0.4/0.3, 4.1/4.4/0.45/0.2}
        \fill[white, opacity=\o] (\x,\y) circle (\r);

      % Three boxes of beans, floating (Wingardium Leviosa!)
      \draw[windowgold, dotted, line width=0.8pt] (7.6,3.35) .. controls (8.0,4.7) and (9.3,3.5) .. (10.0,4.9);
      \foreach \x/\y/\a/\w/\n in {8.3/4.15/-10/0.42/6, 9.45/4.45/8/0.5/9, 10.55/4.0/-6/0.62/20}
        \node[draw=windowgold, fill=mitsilver!35, rotate=\a, minimum width=\w cm, minimum height=0.36cm,
              inner sep=1pt, rounded corners=1pt, font=\scriptsize\bfseries] at (\x,\y) {\n};
      \foreach \x/\y in {7.85/4.0, 8.9/4.75, 9.95/3.95, 10.15/4.95, 7.7/3.6}
        \node[text=windowgold, font=\scriptsize] at (\x,\y) {$\star$};

      % The message
      \node[text=black, opacity=0.5, font=\LARGE\bfseries] at (8.04,5.96) {Thank you for your attention!};
      \node[text=white, font=\LARGE\bfseries] at (8,6.0) {Thank you for your attention!};
    \end{scope}
  \end{tikzpicture}
\end{frame}

\end{document}
