How many?

Suppose you’re in a hallway lined with 100 closed lockers. You begin by opening every locker. Then you close every second locker. Then you go to every third locker and open it (if it’s closed) or close it (if it’s open). (Let’s call this action toggling a locker.) Continue toggling every nth locker on pass number n. After 100 passes, where you toggle only locker #100, how many lockers are open?

_
Click here for the solution

10 lockers are left open, lockers #1, 4, 9, 16, 25, 36, 49, 64, 81, and 100. Each of these numbers are perfect squares. This problem is based on the factors of the locker number. Each locker is toggled by each factor; for example, locker #40 is toggled on pass number 1, 2, 4, 5, 8, 10, 20, and 40. That is eight toggles. The only way a locker could be left open is if it is toggled an odd number of times. The only numbers with an odd number of factors are the perfect squares. Thus, the perfect squares are left open. For example, locker #25 is toggled on pass number 1, 5, and 25 three toggles.

more riddles

How does the man escape?

A man is trapped in a room. The room has only two possible exits: two doors. Through the first door there is a room constructed from magnifying glass. The blazing hot sun instantly fries anything or anyone that enters. Through the second door there is a fire-breathing...

read more

Five-digit number

What is the five-digit number, no zeroes, in which the second digit is three times the first, the third is one more than the second, the fourth is four times the first, and the last is one-half more than the second? The number is: 26789 more...

read more

The peanuts and the monkey

Five men checked into a hotel with a bag of peanuts and a monkey. They planned on dividing the peanuts evenly the following morning. However, during the night, one of the men got up, divided the peanuts into five equal parts, took his fifth and had one leftover peanut...

read more

How many children does Mr. Smith have?

Mr. Smith has 4 daughters. Each of his daughters has a brother. How many children does Mr. Smith have? He has 5 children, all of the daughters have the same 1 brother. more riddlesDonec rutrum congue leo eget malesuada....

read more