Quoto

Learn / Library / Brainteasers

Safe dials on a cycle

BrainteasersHard

safes numbered to each have a dial showing , or , and all dials start at . For each from to , a guard turns the dial of every safe whose number is a multiple of one step forward, so goes to , to and back to . How many dials show at the end?

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

A dial ends at when the number of divisors is a multiple of ; use the prime factorisation.

Solution
  1. The dial of safe ends at exactly when the number of divisors of is a multiple of .
  2. If , the number of divisors is , which is a multiple of exactly when some factor is, that is, for numbers up to , when some exponent equals or .
  3. Up to , the exponent of the prime is exactly for numbers and exactly for numbers; the exponent is exactly for the primes , and in , and numbers.
  4. That is , but and were counted times each.
  5. So dials show , and the answer is .

Answer: