Binomial theorem in ruby