64 is easy it's knowing what other switches are on and why that is the main part of the question.
The latter part of the question isn't terribly well worded. What is it asking for? Which lights beyond 64 are on after all 100 people have walked past?
If so, the answer is (-1)^n where n is the number of factors of the given number excluding 1, and where a result of 1 denotes the light being on at the end of the exercise.
So for light 65, the non-1 factors are 5, 13 and 65, which gives (-1)^3 = -1, so the light will be off. Looking at it number by number, that's 1 on, 5 off, 13 on, 65 off. For 66, non-1 factors 2, 3, 11, 22, 33, 66, giving (-1)^6 = 1, so the light is on. 1 on, 2 off, 3 on, 11 off, 22 on, 33 off, 66 on.
Etc.