Question Number 185515 by HeferH last updated on 23/Jan/23
$$\:{At}\:{a}\:{party}\:{with}\:“{m}''\:{people},\:{a}\:{lady}\:{dances} \\ $$$$\:{with}\:{p}\:{gentlemen},\:{the}\:{second}\:{with}\:{p}\:+\:\mathrm{1},\: \\ $$$$\:{the}\:{third}\:{one}\:{with}\:{p}\:+\:\mathrm{2},\:{and}\:{so}\:{on}\:{until}\:{the} \\ $$$$\:{last}\:{one}\:{dances}\:{with}\:{all}\:{the}\:{gentlemen},\: \\ $$$$\:{find}\:{the}\:{number}\:{of}\:{ladies}\:{who}\:{attended}\:{the} \\ $$$$\:{party}\:{in}\:{terms}\:{of}\:“{m}''{and}\:“{p}''. \\ $$
Answered by manxsol last updated on 23/Jan/23
$${l}+{g}={m} \\ $$$${ladie}_{{l}} \Rightarrow{gentleman}_{{p}+{l}−\mathrm{1}} \\ $$$${p}+{l}−\mathrm{1}={g} \\ $$$${l}+{p}+{l}−\mathrm{1}={m} \\ $$$$\mathrm{2}{l}+{p}−\mathrm{1}={m} \\ $$$${l}=\frac{{m}+\mathrm{1}−{p}}{\mathrm{2}} \\ $$$$ \\ $$