Doors toggled by primes
doors, labelled –, all start open. Janitors act in turn: the -th janitor toggles (opens if closed, closes if open) every door whose number is a multiple of the -th prime (). After all janitors have acted, how many doors are open?
Show hints (2)+
- Door is toggled once per distinct prime factor - that's times. It starts open.
- Open at the end iff is even (including with ). Count those in .
Answer
Reveal answer →Final answer
57
Create a free account to see the full worked solution and track your progress.
Interview format: Market Maker, Systematic & Data-Driven Trading