A and B play a game in which they create a six-digit number: 1.
competition/games/prime.game New
New entry, edited from material collected for the archive and not yet in a released version.
Problem
A and B play a game in which they create a six-digit number:
1. A writes down a first digit (not 0).
2. B writes a second digit (0 allowed from now on). However,
repetition of digits is not allowed.
3. A and B continue alternating, again with no repetition.
A wins if the final six-digit number is composite. B wins if it is
prime. Who should win, and what is his strategy?
Show solution
It seems to me that the odds are all A's way.
COMPLETELY A's way, make that :)
The following win for A depends on the facts that:
- A prime must end in 1, 3, 7, or 9, and
- If the sum of the digits = 0 mod 3, the number is divisible by 3.
A will trap B so that B must produce a number divisible by 3.
A will, on his first two turns, use up the digits 3 and 9.
If B plays 1 or 7 in his first two turns, A has a trivial win by using
up the other one on his third.
On his third turn:
If the sum of B's two digits = 0 mod 3...
A will select 2, 5, or 8 . Whether B plays 1 or 7, the result
will be divisible by 3.
If the sum of B's two digits = 1 mod 3...
A will select 1 or 7, forcing B to play 7 or 1, and the result
will be divisible by 3.
If the sum of B's two digits = 2 mod 3...
A will select 0 or 6. Whether B plays 1 or 7, the result
will be divisible by 3.
-- Pete Kimball <achepak@interaccess.com>
the spoiler solutions are close but not complete.
the 2nd player can block the modality 3 strategy by using up r1's.
1,4,7
and using r2 in one of his moves.
therefore the six cases below have to have a separate strategy:
1274__
1574__
1874__
1472__
1475__
1478__
note player 1 needs a 1,4,or 7 to complete the mod 3 strategy.
but fortunately each number ending in 39 is composite.
so play the 3 and player 2 has 5,9,or an even number.
ta da.
-- Nicholas Kleszczewski <nyknick@panix.com>
[ Editor: the six numbers ending in 39 check: 127439 = 13*9803,
157439 = 313*503, 187439 = 7*26777, 147239 = 113*1303,
147539 = 7*21077, 147839 = 19*7781. ]