Imagine there is a 7x7 grid of lights, and only the
middle in the grid is on.
The lights are wired such that when you flip the switch for one light (from on to off or off to on) the others next to it (not diagonally) flip as well.
Using this weird wiring of lights, what is the fewest number of switch changes it takes to turn all the lights off, and which lights should you switch?
Note: Assume all the switches work in the manner explained, and there is one switch for each of the lights.
Well it's great that Brian and Charlie further expanded the set of solutions.
While I also had some speed-up ideas (like preparing 5n^2 index pairs in advance and equivalencing the grid to a 1d binary counting array), one still is soon stopped in doing a full search when N gets large by the sheer need for computer power. The problem is well suited to multiprocessors, as the 5 points in the pattern could each be handled by a separate processor. Likewise, different parts of the array could be handled by a separate processors. But I will hold off,
since theses methods will not push forward very far.