in this example A3 was the flower number, D2 was the number of the trial (i.e. 3 if every third locker was being opened) ad C3 was the lockers current state.

]]>[spoiler] What characterizes numbers with an odd number of divisors? [/spoiler]

This can be thought of as:

[spoiler] If p is a prime, then how many factors does p^n have?[/spoiler]

[spoiler] If A and B are relatively prime, then the number of factors of A times the number of factors of B = the number of factors of A B (why? Try it out for 2^3 3^3 to see what’s going on) [/spoiler]

[spoiler]

Any flower whose number is a perfect square is closed.

Not a proof, but to quickly verify:

ruby -e ‘a=100;b=Array.new(a+1,1);1.upto(a){|c|c.step(a,c){|d|b[d]^=1}};1.upto(a){|e|print”flower #{e} is “;puts 1==b[e]?”open”:”closed”}’

[/spoiler]