TITLE: Adding digits to make a number prime or composite
QUESTION [10 upvotes]: Players A and B alternate writing one digit to make a six-figure number. That means A writes digit $a$, B writes digit $b$, ... to make a number $\overline{abcdef}$. 
$a,b,c,d,e,f$ are distinct, $a\neq 0$.
A is the winner if this number is composite, otherwise B is. Is there any way to help A or B always win?

REPLY [2 votes]: The existing answers can be simplified: their case splits are unnecessary.
For B to win it is necessary but not sufficient that the final digit B picks is in $\{1, 3, 7, 9\}$.
If A's first pick is $3$ and A ensures that the first three digits include $9$ (i.e. A picks $9$ for the third digit if B didn't pick it for the second digit), then when it comes to A's third pick (choosing the fifth digit from six unpicked digits) we have the following guarantees:

Both $3$ and $9$ have been picked
There is at least one unpicked digit equal to $1 \bmod 3$, and at least one equal to $2 \bmod 3$.
Either there is at least one unpicked digit equal to $0 \bmod 3$, or the sum of the first four digits is $0 \bmod 3$.

Therefore A can always choose the fifth digit such that the sum of the first five digits is $2 \bmod 3$. Then since B needs the final digit to be $1$ or $7$, the number will end up being divisible by $3$ and hence B cannot win.