All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
1,000,000 doors (Posted on 2024-02-11) Difficulty: 3 of 5
There is a special place in the netherworld reserved for mathematicians who play with prime numbers. It consists of a corridor 1000 miles long lined with 1,000,000 doors. Each of the 6666 souls imprisoned there is assigned a prime number, 2, 3, 5, 7, 11, etc.

At the start of the first month all of the doors are closed. Each person must walk down down the corridor, opening or shutting every P-th door, according to the given prime. For example, the soul assigned #5 opens or shuts doors 5, 10, 15, 20, etc.

At the end of a month they have all reached the end of the corridor, and they must start back, performing the operation in the opposite order. For example the #7 soul opens or closes doors 999994, 999987, 999980, 999973, and so forth.

How many months will it be before the doors are all closed again?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution Comment 1 of 1
It's apparent that the counters all reset to zero after completing a run from the fact that #7's first door on the way back is 999994, which is the seventh from the end. There's no leftover amount to be completed from a remainder after the previous run (1,000,000 is not a multiple of 7).

Therefore the same set of doors is affected (toggled) by each pair of run-throughs. So after two pairs of run-throughs, the doors are restored to all closed. The whole process takes 4 months from the beginning of the first phase.

  Posted by Charlie on 2024-02-11 08:40:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information