Then the third student goes down and

takes every third locker, and opens it if it's closed or closes it if it's open.

The student after that changes the state, open or closed, of every fourth locker.

The next changes every fifth locker and so on, so then the question is,

after say, 30 students, what do the lockers look like?

And then what does it look like after 1,000 students?

So this is a problem that was given to me by some colleagues who are math teachers,

which I puzzled over for a couple of days, and

my first inclination was to look at the high tech solution.

Or to look at a solution that I could see in technology which was to put it in

a spreadsheet and color code the different cells based on how the lockers worked.

So on the top row there you see the numbers of the lockers and

the columns each row represents a student who goes and

changes the state so that number one student shuts everything.

And the number two student opens every even one, and

the number three student changes every third one, and so on, on down.

So you can see the patterns,

with the yellow being the open lockers and the blue being the closed.

And you notice, or I was able to notice,

that something was happening on certain numbers, so I put those in red.

Those numbers were 4 and 9 and 16 and 25,

and then 36 and then it looked like that same thing was going to happen on 49.

So what was going on there?

I wasn't sure, these are perfect squares, but why perfect squares?

Puzzled over that for a long time and communicating with colleagues,

we went back and forth.

I'm not sure how much we understood of what each of us was saying.

But in the end what helped me was a representation on a good old white board.