Problem

Source: Taiwan 2014 TST3 Quiz 1, P2

Tags: modular arithmetic, number theory, relatively prime, number theory proposed, primitive root



Alice and Bob play the following game. They alternate selecting distinct nonzero digits (from $1$ to $9$) until they have chosen seven such digits, and then consider the resulting seven-digit number by concatenating the digits in the order selected, with the seventh digit appearing last (i.e. $\overline{A_1B_2A_3B_4A_6B_6A_7}$). Alice wins if and only if the resulting number is the last seven decimal digits of some perfect seventh power. Please determine which player has the winning strategy.