in reply to What is wrong with the code ?

You may want to look at the Math::Combinatorics module, and see if the nCk combination will produce the result you seek.

     You're just jealous cause the voices are only talking to me.

     No trees were killed in the sending of this message.    However, a large number of electrons were terribly inconvenienced.