|Light, More Light|
Katja likes to switch the lights off and on in different hallways at Hochschule Ravensburg-Weingarten. A hallway has n lights, each controlled by one toggle switch. The first time a toggle switch is pressed, the light turns on. The second time a toggle switch is pressed, the light turns off. Etc. Katja walks along this corridor back and forth n times. On the kth walk she toggles only the switches whose position is evenly divisble by k. She does not press any switch when returning to the start of the hallway. The kth walk is defined as going down the hallway and coming back again.
For this problem, you must write a program that determines the state of the final bulb.
There will be an unknown number of positive integers in the file, terminated by a 0. Each positive integer indicates the number of bulbs in the corridor, n. n is ≤ 232-1. Do not process the 0.
Output yes if the light is on, otherwise no. Each answer should appear on a single line.
3 6241 8191 0
no yes no