|
|
Scott Cram Inner circle 2678 Posts |
Here's an intriguing puzzle for you:
You have a row of lights (and corresponding switches), labeled from 1 to 1,000,000 (1 million) in order. You start with all the lights off. Starting with light 1, you "change the state" of each and every light. When I say, "change the state", I mean that if a light is already on, you turn it off and if it's already off, you turn it on. Obviously, this first state change ends with all the lights on. Next, you start at light 2, and change the state of every other light bulb. So, in this case, all the even numbered lights are out, and the odd numbered lights remain on. Next, you start at light 3, and change the state of every third light (things start to get tricky starting right about here). So, 3 goes out, 6 goes on, 9 goes out, and so on. I think you can see the pattern of switching by now. The next step would be start at light 4, and changing the state of every fourth light, followed by starting at light 5, and changing the state of every fifth light, and so on up to starting at light 1,000,000 (1 million) and changing the state of every "millionth" bulb (ok, you only have 1 to worry about at that point). Here's the question: Once you've run through this entire exercise, which lights will be on? Some of you may be considering writing a program to find the answer, but there's a very simple "A-ha!" that will make the problem very simple to solve. |
Alessandro Scotti Loyal user Italy 263 Posts |
The lights on should be those corresponding to numbers that have an odd number of divisors, including in those 1 and the number itself.
Walk of Mind: the best source of bad magic
|
Scott Cram Inner circle 2678 Posts |
Not bad, Alessandro. Some may find this explanation a little dry, though.
Does anybody know what the more common name for numbers with an odd number of divisors, including 1 and itself, is? |
wayman Special user England - Sunderland 589 Posts |
|
Alessandro Scotti Loyal user Italy 263 Posts |
Quote:
On 2003-07-16 13:54, wayman wrote: Wow you are right Wayman, and the explanation contained in the story you posted is so "simple" and ingenuous... I am really amazed!
Walk of Mind: the best source of bad magic
|
sourcerer Regular user Netherlands 175 Posts |
LOL....that last sentence of that story cracked me up.
Very good explanation though...it had me floored, too stuck on a binary thinking path. Thx for sharing, Kaj :o) |
The Magic Cafe Forum Index » » Puzzle me this... » » Which lights? (0 Likes) |
[ Top of Page ] |
All content & postings Copyright © 2001-2024 Steve Brooks. All Rights Reserved. This page was created in 0.02 seconds requiring 5 database queries. |
The views and comments expressed on The Magic Café are not necessarily those of The Magic Café, Steve Brooks, or Steve Brooks Magic. > Privacy Statement < |