You plan to organize your birthday party, which will be attended either by exactly $m$ persons or by exactly $n$ persons (you are not sure at the moment). You have a big birthday cake and you want to divide it into several parts (not necessarily equal), so that you are able to distribute the whole cake among the people attending the party with everybody getting cake of equal mass (however, one may get one big slice, while others several small slices - the sizes of slices may differ). What is the minimal number of parts you need to divide the cake, so that it is possible, regardless of the number of guests.
Problem
Source: 2022 Saudi Arabia JBMO TST 2.4
Tags: number theory, combinatorics
expsaggaf
17.06.2024 01:16
Let $f(m, n)$ denote the minimum for $m, n$. I claim that $f(m, n) = m + n - \gcd(m, n)$ for all $m, n$.
Assumptions: Let the cake's mass be $mn$, let $m \le n$, and $n = mk_1 + r_1$.
Claim: $f(m, n) = mk_1 + f(m, r_1)$
Proof: Consider the cake split into $m$ slices, each of mass $n$. We want to divide the slices in such a way that they can form $n$ slices, each of mass $m$.
It's trivial that each of the final slices must have a mass lesser than or equal to $m$, so the least amount of slices we must cut one slice of mass $n$ into is equal to $k_1 + 1$. To make sure that we have the least amount of slices to form the slices of mass $m$, we can cut each slice of mass $n$ into $k_1$ slices of mass $m$, and $1$ slice of mass $r_1$. Then we will end up with $mk_1$ slices of mass $m$, and $m$ slices of mass $r_1$. We can set the $mk_1$ slices of mass $m$ aside since they are all equal to $m$. We are left with turning $m$ slices of $r_1$ into $r_1$ slices of $m$ using the least amount of slices possible, which will leave us with $f(m, r_1)$ slices. Therefore $f(m, n) = mk_1 + f(m, r_1)$.
Claim: $f(m, n) = m + n - \gcd(m, n)$
Proof: If $f(m, n) = m + n - \gcd(m, n)$, then $f(m, r_1) = f(m, n) - mk_1 = m + r - \gcd(m, r_1)$, and if $f(m, r_1) = m + r_1 - \gcd(m, r_1)$ then $f(m, n) = mk_1 + f(m, r_1) = m + n - \gcd(m, n)$ since $\gcd(m, n) = \gcd(m, r_1)$.
Therefore $f(m, n) = m + n - \gcd(m, n) \iff f(m, r_1) = m + r_1 - \gcd(m, r_1)$.
We can continue similarly to get $f(m, n) = m + n - \gcd(m, n) \iff f(m, r_1) = m + r_1 - \gcd(m, r_1) \iff f(r_2, r_1) = r_2 + r_1 - \gcd(r_2, r_1) \iff ... \iff f(\gcd(m, n), \gcd(m, n)) =\gcd(m, n) + \gcd(m, n) - \gcd(\gcd(m, n), \gcd(m, n)) = \gcd(m, n)$ which is trivial. Therefore our proof is finished.