Learn / Library / Brainteasers
Safe dials on a cycle
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.
Hint
A dial ends at when the number of divisors is a multiple of ; use the prime factorisation.
Solution
- The dial of safe ends at exactly when the number of divisors of is a multiple of .
- 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 .
- 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.
- That is , but and were counted times each.
- So dials show , and the answer is .
Answer: