MathDB
Two girls play the longest game ever

Source: Pan-American Girls' Mathematical Olympiad 2022, P6

October 30, 2022
number theoryPAGMOprime numbers

Problem Statement

Ana and Bety play a game alternating turns. Initially, Ana chooses an odd possitive integer and composite nn such that 2j<n<2j+12^j<n<2^{j+1} with 2<j2<j. In her first turn Bety chooses an odd composite integer n1n_1 such that n11n+2n++(n1)n2(n1)n1.n_1\leq \frac{1^n+2^n+\dots+(n-1)^n}{2(n-1)^{n-1}}. Then, on her other turn, Ana chooses a prime number p1p_1 that divides n1n_1. If the prime that Ana chooses is 33, 55 or 77, the Ana wins; otherwise Bety chooses an odd composite positive integer n2n_2 such that n21p1+2p1++(p11)p12(p11)p11.n_2\leq \frac{1^{p_1}+2^{p_1}+\dots+(p_1-1)^{p_1}}{2(p_1-1)^{p_1-1}}. After that, on her turn, Ana chooses a prime p2p_2 that divides n2,n_2,, if p2p_2 is 33, 55, or 77, Ana wins, otherwise the process repeats. Also, Ana wins if at any time Bety cannot choose an odd composite positive integer in the corresponding range. Bety wins if she manages to play at least j1j-1 turns. Find which of the two players has a winning strategy.