solving summation puzzles, recursive permutation