Quoto

Learn / Library / Brainteasers

A rare toggle count

BrainteasersMedium

lockers numbered to start closed. For each from to , person toggles every locker whose number is a multiple of . How many lockers are toggled exactly times in total?

Checking an answer needs JavaScript. The hint and the solution open without it.

A whole number, a decimal, a fraction like 3/8 or a percent.

Hint

Which numbers have exactly divisors?

Solution
  1. Locker is toggled once per divisor of , so we need numbers with exactly divisors.
  2. An odd number of divisors means is a square, and divisors means for a prime , with divisors , and .
  3. With the primes are , , and , giving , , and .
  4. So the number of such lockers is .

Answer: