Qm

Writing digits to reach a multiple of nine

Two players build a six-digit number by writing one digit at a time, left to right, alternating, with the first player writing the first digit (which must not be 0). The first player wants the finished number to be divisible by 9; the second player wants it not to be.

  1. Who wins with best play?
  2. Now swap the goals: the first player wants the number not divisible by 9 and the second player wants it divisible. Who wins?
Show a hint

A number is divisible by 9 exactly when its digit sum is. Think about what the player writing the very last digit can do to the digit sum.

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Twenty coins in a circleGuess each other's coinPlacing knights so that none attackNim where the last stone losesRacing a rook to the corner
All questions →