<p>This is well-known <a href="https://en.wikipedia.org/wiki/Change-making_problem" rel="nofollow noreferrer">Change-making problem</a>, which is (weakly) NP-hard problem.</p>

<p>As for all problems of such kind, there are several algorithms depending on how good solution do you want to find (usually it's <em>easy</em> to find <em>somehow good</em> solution and <em>hard</em> to find the <em>best</em> solution). Feel free to do your own research and select the one that suits your needs best.</p>

<p>As showed in a few other answers on *Overflow/Exchange network like <a href="https://cs.stackexchange.com/questions/6552/when-can-a-greedy-algorithm-solve-the-coin-change-problem">1</a>, <a href="https://stackoverflow.com/questions/6025076/how-to-tell-if-greedy-algorithm-suffices-for-finding-minimum-coin-change/6031625#6031625">2</a>, <a href="https://math.stackexchange.com/questions/25209/looking-to-understand-the-rationale-for-money-denomination">3</a> there is criteria for a given coin system [<a href="http://graal.ens-lyon.fr/~abenoit/algo09/coins2.pdf" rel="nofollow noreferrer">4</a>][<a href="https://arxiv.org/PS_cache/arxiv/pdf/0809/0809.0400v1.pdf" rel="nofollow noreferrer">5</a>] when greedy algorithm is optimal (such systems are called <em>canonical coin systems</em>). For your case if you have 1, 5 and 10-user possible licenses, greedy algorithm <strong>is optimal</strong>.</p>

<p>[<a href="http://graal.ens-lyon.fr/~abenoit/algo09/coins2.pdf" rel="nofollow noreferrer">4</a>] D. Pearson. A Polynomial-time Algorithm for the Change-Making Problem</p>

<p>[<a href="https://arxiv.org/PS_cache/arxiv/pdf/0809/0809.0400v1.pdf" rel="nofollow noreferrer">5</a>] Xuan Cai and Yiyuan Zheng. Canonical Coin Systems for Change-Making
Problems</p>
Python Math: If number is between
<p>I am currently learning Python and my idea would be to convert an existing Excel project into a web application. </p>

<p>As part of the configuration required in the project the user requires licenses for certain features. Example, if there are a total of 17 users that require a feature, the licenses are available for 1 user, 5 users, 10 users, 20 users.</p>

<p>So to cater for the 17 users above I would require:
2 x 1 user
1 x 5 user
1 x 10 user</p>

<p>The configuration consists of over 400 different licenses.</p>

<p>Achieving the above is possible using IF, ELIF and ELSE and returning the remainder and then looping all over again until the remainder is 0.</p>

<p>I am sure there would be a more productive way to go about the above.</p>

<p>Any advise or how to go about wording this better in a search to do more research?</p>

<p>Your assistance is appreciated.</p>