# At the end of the ceremony how many lockers are open?

+1 vote
239 views

A middle school has a strange principal. On the first day, he has his students perform an odd opening day ceremony:

There are one thousand lockers and one thousand students in the school. The principal asks the first student to go to every locker and open it. Then he has the second student go to every second locker and close it. The third goes to every third locker and, if it is closed, he opens it, and if it is open, he closes it. The fourth student does this to every fourth locker, and so on.
At the end of the ceremony how many lockers are open?

posted Jun 9, 2014

The only lockers that remain open are perfect squares (1, 4, 9, 16, etc) because they are the only numbers divisible by an odd number of whole numbers; every factor other than the number's square root is paired up with another. Thus, these lockers will be 'changed' an odd number of times, which means they will be left open. All the other numbers are divisible by an even number of factors and will consequently end up closed.

So the number of open lockers is the number of perfect squares less than or equal to one thousand. These numbers are one squared, two squared, three squared, four squared, and so on, up to thirty one squared. (Thirty two squared is greater than one thousand, and therefore out of range.) So the answer is thirty one.

Similar Puzzles
+1 vote

If Kareem Khan is standing in a row of prisoners at 9th position from both end of a line. How many Prisoners are standing in total ?

In how many ways the letters of the word ‘CHEKOSLOVAKIA’ can be arranged such that “SL” always comes together and ‘H’ and ‘I’ at the end places?

An intelligent trader travels from one place to another carrying 3 sacks having 30 coconuts each. No sack can hold more than 30 coconuts. On the way he passes through 30 checkpoints and on each check point he has to give one coconut for each sack carrying.

How many coconuts are left in the end?

There are 100 doors in a row, all doors are initially closed. A person walks through all doors multiple times and toggle (if open then close, if close then open) them in following way:

In first walk, the person toggles every door.

In second walk, the person toggles every second door, i.e., 2nd, 4th, 6th, 8th, …

In third walk, the person toggles every third door, i.e. 3rd, 6th, 9th, …

………
……….

In 100th walk, the person toggles 100th door.

Which doors are open in the end?
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.queryhome.com/puzzle/1155/at-the-end-of-the-ceremony-how-many-lockers-are-open", "fetch_time": 1718708548000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-26/segments/1718198861752.43/warc/CC-MAIN-20240618105506-20240618135506-00711.warc.gz", "warc_record_offset": 838722014, "warc_record_length": 26315, "token_count": 611, "char_count": 2482, "score": 3.703125, "int_score": 4, "crawl": "CC-MAIN-2024-26", "snapshot_type": "latest", "language": "en", "language_score": 0.9654181003570557, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00018-of-00064.parquet"}