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
Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.
Asked at: Jane Street, Two Sigma