Imagine there are 100 lockers. Each locker is given a number 1-100. When the students are assigned to their lockers, the 1st student runds down the row of lockers and opens every door, student #2 closes the doors of locker #'s, 2,4,6,8, etc. to the end of the line. Student #3 changes the state of the doors of lockers 3,6,9,12, etc., student #4 open doors are closed, and closed doors are open. What patterns are developed and which lockers were open at the end, and why were they open?

This a classic and very old problem

As a matter of fact, if you google
"locker closing problem" you get quite a few hits.

Here is your problem extended to 1000 lockers.
enter 1 into the window, then 2, then 3 etc. to see that pattern developing.

(Broken Link Removed)

On this page there is a good explanation under the heading of "Using locker boards" a bit down the page

http://mathforum.org/alejandre/frisbie/student.locker.html

Here is a clip where some grade 3's illustrate the problem using cards.

(Broken Link Removed)

Enjoy

To determine the lockers that remain open at the end and identify the patterns, we need to go through the assigned actions of each student step by step.

Step 1: The first student runs down the row and opens every door. As a result, all the lockers are now open.

Step 2: The second student closes the doors of locker #2, #4, #6, #8, and so on, until the end of the line. This means that all the even-numbered lockers are now closed.

Step 3: The third student changes the state of the doors of lockers #3, #6, #9, #12, and so on. This means that the lockers which had been closed by the previous student will now be open, and vice versa. So, lockers #3, #6, #9, #12, and so on, are now open, while the rest remain closed.

Step 4: The fourth student opens the lockers that are currently closed and closes the ones that are open. So, as a result, lockers #1, #4, #5, #9, #10, #13, and so on, will be open, while the others will be closed.

These steps continue with subsequent students, and the pattern that emerges is that every locker will have been visited a certain number of times, depending on how many factors it has. For example, locker #8 will have been visited by the 1st student, the 2nd student (closed), the 4th student (opened), and the 8th student (closed), resulting in it being closed at the end.

The lockers that end up open are the ones that have an odd number of factors. Factors are the whole numbers that divide a given number evenly. For example, locker #9 has factors 1, 3, and 9. Since it has an odd number of factors, it will be open at the end.

In general, lockers numbered as perfect squares (e.g., 1, 4, 9, 16, etc.) have an odd number of factors because their factors come in pairs, except for the square root itself. Therefore, these lockers will be open at the end.

So, in this scenario with 100 lockers, the open lockers at the end will be locker #1, #4, #9, #16, #25, #36, #49, #64, #81, and #100.