Lights on Lights off | Math Problem

Click here to read the complete problem statement.