Find amounts that cannot be composed using the given coins
Your code looks frighteningly slow because of the 5 nested for loops, and indeed it is.

To find an efficient algorithm, you should switch off the computer, take out a sheet of paper and solve the following task on paper:


  Given an infinite amount of coins labelled 5, 7, 16, which amounts between 1 and 100 can be composed?


While you solve that task, ask yourself in every step:


what am I doing?
why do I do this?
what do I want to achieve?
can I formulate a general rule for this that sounds reasonable, appropriate for the task?


Your current code counts up to 2000 several times. In this manual task there is no point counting up to 2000. This alone makes your algorithm more specialized than it needs to.

Essentially your code should be defined in a function like this:

/**
 * @return the amounts between min and max that are &lt;i&gt;not&lt;/i&gt; composable
 * from an infinite supply of coins of the given values.
 */
public static BitSet uncomposable(int min, int max, List&lt;Integer&gt; coinValues) {
    …
}


In that code, neither the number 100 nor 10000 nor 2000 must appear.
There should be at most 2 nested loops.
How exactly the code looks like depends on how you solved the task on paper.
I'm sure you won't choose a time-consuming algorithm when having to do this task manually.

Bonus question: is there a limit beyond which all amounts are composable? That could be used to stop the computation early, which is a nice optimization. Try with these test cases:


{1}: the limit is 0, obviously
{2}: there's no limit since only even numbers are covered
{2, 4, 6}: …
{3, 5}: …
{1, 7, 14}: …