Help on Algebra Problem I need help on this problem that 8/9 Grade Math Teacher Assigned me (I'm in 7th Grade). Here's the problem -

Today is Latisha's birthday. Fifty friends have thrown her a surprise party. Before the party, her friends got together and decided to secretly hide several presents in 50 separate boxes numbered 1 to 50.
Latisha is now about to open her gifts, which are arranged in a row in order. Her friends explain that if she follows the instructions below, she will discover which boxes hold a gift.
Latisha wants you to help her figure out which boxes hold presents without actually carrying out their instructions.
Their Instructions:
First, she should go down the line and open every box.
Then, starting with box #2, she should close every other box as she goes down the row.
Starting with box #3, she should change every third box (she opens the box if it is closed and closes it if the box is open)
Starting with box #4, she should change every fourth box.
Starting with box #5, she should change every fifth box.
Continue this process through box #50.

Basically, the boxes at the end that are open are the ones with presents in them. I think that you would have to use a factorial-related-strategy, but I'm not sure. Can anyone help?

A box is flipped once for every divisor its number has and it starts from closed, so it is closed if it has an even number of divisors and open if it has an odd number of divisors. 
So this is progress, but it would be good to simplify the answer further. So we need to figure out how to tell whether a number has an even or odd number of divisors other than by counting them. The key here is to note that usually, divisors come in pairs. Say you're look for divisors of $10$. Then you have $1$ and $10,$ and $2$ and $5$... two pairs of divisors for a total of 4. So it seems like this would imply that usually there are an even number of divisors. But there is one situation where the above logic fails and you can have an odd number of divisors. 
