Solution to (B)
Let's looking at the configurations

, where

is the configuration obtained after

steps. Denote

be the number assigned to light

in configuration

.It's easy to see that, working in

,

. (This is true, since two adjacent numbers (1,1), (1,0), (0,0), (0,1) are changed to (1,0), (1,1), (0,0), (0,1) respectively). From there, an induction gives us, that for

,

.
Looking at Pascal's triangle, for

we notice that the sequence:

is identical to

.
Using

, and well-known properties of Pascal triangle (i.e.:

), and induction, we can see that this pattern
is true

. In particular, let's look at configuration

: for

, we have

.
But since the binary representation of

contains at least one

, and

contains only

-s, it follows that, working in

,

for

- so after

steps we end up with a configuration with a

for light #

, and a

for every other light.
From there, after

steps, since each following steps toggles one light, we will have configuration with all lights on.