With logic-puzzles like this, I like to think through a few specific cases first and see if I can figure out a pattern.
My first guess was that prime-numbered scooters would wind up wheels-up. I thought about the 7th scooter. It will be flipped upside down by the first student and will be flipped upright again by the seventh student. In fact, this will happen for every prime-numbered scooter: the first student will flip it upside down and it will remain upside down until the student with that number flips it right side up. Then, it won't be touched again. So, actually, every prime-numbered scooter will end up right side up. That's because it has exactly one pair of factors: 1 and itself.
So, from that thought-process, we can guess that this has something to do with the factors associated with the numbers from 1 to 1000. Let's pick something with a lot of factors, like the 12th scooter, and see what happens to it. Its factors are 1, 2, 3, 4, 6, and 12, so the first student will flip it upside down, the second will flip it right side up, the third will flip it upside down, the fourth will flip it right side up, the sixth will flip it upside down, and the twelfth will flip it right side up. So 12, like 7, ends right side up. Again, that's because its factors come in pairs: 1 and 12 make 12, 2 and 6 make 12, and 3 and 4 make 12, so for every student who flips it upside down (the third, for example), another will eventually come to flip it right side up (the fourth, for example).
That means pretty much any number we can think of will result in a right side up scooter, because pretty much any number we can think of has an even number of factors: 200 has 1 and 200, 2 and 100, 4 and 50, 5 and 40, 8 and 25, and 10 and 20; 21 has 1 and 21 and 3 and 7; etc. When will we ever get an odd number of factors?
It turns out there's only one particular case that we'll get an odd number of factors. Remember that, for most numbers, factors come in pairs. For every student who flips a scooter upside down, his pair student will flip the scooter right side up again. But what if a student's pair was himself? In other words, what if one of the factors' pairs was the factor itself?
Think about the case of the 4th scooter. 4 has the factor pairs 1 and 4 and 2 and 2. Notice that, in the second factor pair, the factor 2 pairs with itself. That means the scooter will be flipped upside down by the first student, right side up by the second student, and upside down again by the fourth student. There was no one to undo the second student's flip, so the scooter does actually wind up wheels-up.
The same will happen for the 16th scooter: 16 has the factor pairs 1 and 16, 2 and 8, and 4 and 4. That means it gets flipped 5 times (1, 2, 4, 8, and 16), winding up wheels-up.
So, for which set of numbers is one of the factor pairs a number and itself? The answer is, all of the perfect squares, by definition. A number which can be expressed as the product of a number and itself is a perfect square. So, every perfect square scooter and only perfect square scooters will remain wheels-up, since they are the only scooters whose numbers have an odd number of factors.
That means that 31 scooters are wheels up, because they are perfect squares, which have an odd number of factors:
1×1 = 1 (1 factor: 1)
2×2 = 4 (3 factors: 1, 2, 4)
3×3 = 9 (3 factors: 1, 3, 9)
4×4 = 16 (5 factors: 1, 2, 4, 8, 16)
5×5 = 25 (3 factors: 1, 5, 25)
6×6 = 36 (9 factors: 1, 2, 3, 4, 6, 9, 12, 18, 36)
7×7 = 49 (3 factors: 1, 7, 49)
.
.
.
29×29 = 841 (3 factors: 1, 29, 841)
30×30 = 900 (27 factors: 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 25, 30, 36, 45, 50, 60, 75,
90, 100, 150, 180, 225, 300, 450, 900)
31×31 = 961 (3 factors: 1, 31, 961)
And we'll have to stop there, because 32×32 = 1024, which is too big.