Wow, this has moved on since I've been away.

I knew my code failed quite a few of the combinations, but I asked Jens to post it for me as I didn't have time to fix it and I thought you might be interested in the recursive function call for phase 2 of the game.

To test it I ran it through all 9999 iterations and then eliminated the duplicates to get a count. No out-of-memory errors on 4.11 RC1