Numsprite數靈精Play free
中文

Maths olympiad question · P5–P6★★★ Hard

Divisibility and factors: olympiad question 6

A hard question on divisibility and factors for P5–P6, with a step-by-step solution, diagrams and the answer. Common in the Hua Xia Cup's P4 and P5 qualifying rounds and finals; harder ones use how many factors a number has, and square numbers.

The question

A school corridor has 68 lockers numbered 1 to 68, all closed to begin with.

68 pupils walk past one after another: pupil 1 flips the door of every locker whose number is a multiple of 1; pupil 2 flips every multiple of 2; pupil 3 every multiple of 3; and so on up to pupil 68.

To "flip" a door means to open it if it is closed and close it if it is open.

After all 68 pupils have passed, how many lockers are open?

Show the hints (3)
  1. Hint 1: Take one locker, say number 12: which pupils flip its door?
  2. Hint 2: A door flipped an odd number of times ends up open, an even number closed. The number of flips is the number of factors of the locker's number.
  3. Hint 3: Factors usually come in pairs, like 12 = 3 × 4. Which numbers have an odd number of factors?

Worked solution

Have a go first, then read the solution step by step.

  1. 1.Pupil k flips locker n only when k is a factor of n: locker 12, say, is flipped only by pupils 1, 2, 3, 4, 6 and 12. So each door is flipped as many times as its number has factors.
  2. 2.12's factors pair up (1 × 12, 2 × 6, 3 × 4): 6 of them, even, so locker 12 ends up closed.
  3. 3.Only square numbers (like 9 = 3 × 3, with factors 1, 3, 9) have a pair made of one number twice, so they have an odd number of factors and end up open.
  4. 4.Squares up to 68: 1 × 1 = 1, 2 × 2 = 4, 3 × 3 = 9, 4 × 4 = 16, 5 × 5 = 25, 6 × 6 = 36, 7 × 7 = 49, 8 × 8 = 64 — 8 of them, so 8 lockers are open.
  5. ⚠️Common mistake: guessing about half are open and answering 34.

Answer: 8 lockers

Play more like this in Numsprite (unlimited questions, instant marking) →A free maths game: every level free from Easy to Expert (★ to ★★★★), unlimited questions, no download