in reply to amount permutations

That's a very hard problem. Even the question is there a subset that totals to the given amount is NP-complete, and is known as the knapsack problem.

Abigail