Problem

Source: 2021 China TST, Test 1, Day 2 P6

Tags: number theory, greatest common divisor, least common multiple



Given positive integer $n$ and $r$ pairwise distinct primes $p_1,p_2,\cdots,p_r.$ Initially, there are $(n+1)^r$ numbers written on the blackboard: $p_1^{i_1}p_2^{i_2}\cdots p_r^{i_r} (0 \le i_1,i_2,\cdots,i_r \le n).$ Alice and Bob play a game by making a move by turns, with Alice going first. In Alice's round, she erases two numbers $a,b$ (not necessarily different) and write $\gcd(a,b)$. In Bob's round, he erases two numbers $a,b$ (not necessarily different) and write $\mathrm{lcm} (a,b)$. The game ends when only one number remains on the blackboard. Determine the minimal possible $M$ such that Alice could guarantee the remaining number no greater than $M$, regardless of Bob's move.