# Lights in the theatre

A play of Romeo and Juliet is being held in the theatre tonight, hundred of people have been waiting this moment for months.
Many people are currently working hard in the theatre to adjust the final details.
Ernest's job is to ensure an adequate lighting in the theatre, else it would be impossible for the actors to perform.
Today, Ernest is experiencing a weird issue with his $1000$ lights: when he triggers the switch of the $i_{th}$ light, it changes status along with all its multiples. For example, triggering the $3$rd switch will change status to the lights with index $3,6,9,12,...$.
Suppose that all the lights are initially off.
Ernest is not a mathematician and is in hurry, so you must tell him how many lights will be on if he triggers all the switches.
You tell him the answer and he thinks that this number of lights is enough. Unintentionally, when it's the right moment to turn on the lights, he breaks the first five switches because of haste!
Now he wants to know the maximum number of lights he can turn on! Is it still enough for the play?

Notes: The broken switches are off.

• Just to clarify, when he breaks the switches no lights have been affected yet? Also, how many lights are required to be on to be 'enough for the play'? – Mark N Apr 27 '15 at 20:07
• Yes! The first answer is an adequate number, confront the second answer with it – leoll2 Apr 27 '15 at 20:11
• Are we to assuming in the first part he flips the switches only once and consecutively from 1 to 1000? Also is he only allowed to flip each switch once in the second scenario (in any particular order)? – Mark N Apr 27 '15 at 20:18
• @MarkN order is unimportant; these are toggles. If you flip switches $S_3$ and $S_6$, light $L_3$ is on and $L_6$ is off, regardless of order. – Ian MacDonald Apr 27 '15 at 20:21
• @VincentAdvocaat The switches are in a room where you can't see the lights directly. Anyway, perhaps we should stop messing with the story and focusing on the problem :) – leoll2 Apr 28 '15 at 13:01