Can someone explain how the state machine works for a range in a boolean expression? I'm trying to figure out WHY the block below would give a value for 17 rather than nil (and also, why wouldn't 15 pass the i%3 == 0 test?)

Code:
a = (11..20).collect {|i| (i%4 == 0)..(i%3 == 0) ? i : nil}  
a   [nil, 12, nil, nil, nil, 16, 17, 18, nil, 20]


And what is happening internally with the example below?

Code:
a = (11..20).collect {|i| (i%4 == 0)...(i%3 == 0) ? i : nil}  
a   [nil, 12, 13, 14, 15, 16, 17, 18, nil, 20]