Author |
Topic: Imp Riddle (Read 2300 times) |
|
Ela
Newbie
Gender:
Posts: 25
|
|
Imp Riddle
« on: Jul 18th, 2012, 11:10pm » |
Quote Modify
|
In a town of imps there are 1,000 residents. At dusk, the first resident has turned the switch 'ON' to 1,000 lamps, right after him came the second imp, and turned off every second light. right after him the third imp started to turn off every light that was on and turning 'on' every light that was 'off' just if it was a lump number that is divided by 3. and so on for the forth.... fifth..... untill the last resident. Q: After the last resident in imp Town , finish his duties, how many lamps stayed lighten ? explain your answer.
|
|
IP Logged |
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: Imp Riddle
« Reply #1 on: Jul 19th, 2012, 5:35am » |
Quote Modify
|
There's a version of this somewhere around here already - with a mad gaoler and 100 prison cells. The answer is: hidden: | The lamps whose number has an odd number of factors will be lit, ie those with numbers that are perfect squares |
|
|
IP Logged |
|
|
|
Ela
Newbie
Gender:
Posts: 25
|
|
Re: Imp Riddle
« Reply #2 on: Jul 19th, 2012, 6:17am » |
Quote Modify
|
that's close. but not the answer i need an exact answer with a reason.
|
|
IP Logged |
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: Imp Riddle
« Reply #3 on: Jul 20th, 2012, 4:11am » |
Quote Modify
|
Okay: 31 Reason: because I said so!
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Imp Riddle
« Reply #4 on: Jul 20th, 2012, 8:46am » |
Quote Modify
|
I liked the first reason better Another reason: Python Code:a = []; for i in range(1000): a.append(0); for i in range (1, 1001): for j in range (1, 1001): if j % i == 0: a[j-1] = 1 - a[j-1]; sum(a) |
| Which gives the same answer.
|
« Last Edit: Jul 20th, 2012, 8:47am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
0.999...
Full Member
Gender:
Posts: 156
|
|
Re: Imp Riddle
« Reply #5 on: Jul 20th, 2012, 7:22pm » |
Quote Modify
|
I got a different answer when I tried it on my string of 1000 "Christmas" lights.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Imp Riddle
« Reply #6 on: Jul 21st, 2012, 1:52am » |
Quote Modify
|
Really? On the third round, how did you turn on the sixth light?
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
0.999...
Full Member
Gender:
Posts: 156
|
|
Re: Imp Riddle
« Reply #7 on: Jul 21st, 2012, 5:35am » |
Quote Modify
|
By "it" I mean the version of the riddle that follows from me misreading the text.
|
|
IP Logged |
|
|
|
Ela
Newbie
Gender:
Posts: 25
|
|
Re: Imp Riddle
« Reply #8 on: Jul 22nd, 2012, 1:00am » |
Quote Modify
|
Thanks!
|
|
IP Logged |
|
|
|
|