Problem

Source: 2022 Saudi Arabia JBMO TST 2.4

Tags: number theory, combinatorics



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.