>>Well, since Edward already solved it I won't press on, especially since time is a premium right now. :-)
>>
>>However, this excercise brings up an interesting thought. We are extremely dependent on computer machinations to solve our problems for us, and rightly so since many of them can only be solved thru numeric analysis. Nevertheless, it still seems better to use a closed form solution to a problem if it exists for both expediency and the excercise of the mind, :-)
>>
>Yes, although I think all of us could do the looping code in a matter of 2 or 3 minutes, and while one might spend hours on the math solution, the math solution is none-the-less a thing of beauty compared to the code...and a good mental exercise, as well. Now, who wants to volunteer to prove the math solution by combinatorial anaysis (no induction allowed). (s)
Bruce, I didn't use combinatorics to find solution. There is another purely algebra method to do this.
Edward Pikman
Independent Consultant