Find the largest whole-number amount that cannot be formed using unlimited coins of two denominations. Enter integers greater than 1 that are coprime, meaning their greatest common divisor is 1. Both denominations must use the same unit.
Check coprimality before using the result. This calculator evaluates ab − a − b; it does not test whether the inputs are coprime. Its result is a Frobenius number only when the stated conditions hold.
The denominations 4 and 7 are coprime. The formula gives 4 × 7 − 4 − 7 = 17. No nonnegative combination of 4s and 7s makes 17.
The next four amounts are reachable: 18 = 4 + 7 + 7; 19 = 4 + 4 + 4 + 7; 20 = 5 × 4; and 21 = 3 × 7. Adding more 4s to these combinations reaches every integer amount above 17.
| Denomination a | Denomination b | Largest unreachable amount |
|---|---|---|
| 3 | 5 | 7 |
| 4 | 7 | 17 |
| 5 | 8 | 27 |
| 7 | 11 | 59 |
What if the denominations are not coprime?
There is no largest unreachable integer amount. For example, coins of 4 and 6 can make only even amounts, so arbitrarily large odd amounts remain unreachable. Ignore the formula output for such inputs.
What if one denomination is 1?
Every nonnegative integer amount is reachable, so there is no largest unreachable nonnegative amount. This calculator restricts both denominations to integers greater than 1.
Can I use decimal currency denominations?
First express both denominations as integers in the same smallest unit, such as cents. Check coprimality in that unit. The answer is expressed in that same unit.
Does this work with limited coins or three denominations?
No. The formula assumes unlimited supplies of exactly two denominations and nonnegative integer coin counts. Limited supplies or additional denominations require a different calculation.

