number permutations with constraints (solved with java programs and math)

Published --