If 31z5 is a multiple of 9, where z is a digit, what is the value of z? Explain why there are two answers to this problem.
Hint. Apply the digit-sum test, then remember z can be any digit from 0 to 9.
Step 1 — Apply the divisibility test for 9. The digit sum is 3 + 1 + z + 5 = 9 + z, and this must be a multiple of 9.
Step 2 — Find which digits work. Since z is a single digit, 9 + z runs from 9 to 18. The multiples of 9 in that range are 9 and 18: • 9 + z = 9 → z = 0 • 9 + z = 18 → z = 9
Step 3 — Explain why there are two answers. The digit sum already contains 9, so it is a multiple of 9 before z is added. Adding z keeps it a multiple of 9 only when z itself contributes a whole extra 9 — or nothing at all. Both 0 and 9 leave the remainder unchanged, since 9 ≡ 0 (mod 9). That is exactly why two digits work rather than one.
More generally, whenever a digit-sum condition has one solution z, the value z + 9 also works if it is still a single digit. Here z = 0 gives the second solution z = 9.
Check: 3105 → digit sum 9, and 3105 ÷ 9 = 345 ✓ Check: 3195 → digit sum 18, and 3195 ÷ 9 = 355 ✓
✦ z = 0 or z = 9. The digit sum is 9 + z, and both 0 and 9 leave it a multiple of 9 because 9 ≡ 0 (mod 9).
