[math-fun] [SOLUTION] Combinatorics of shell substitution