Artificial intelligent assistant

Find a value $x$, such that if we had $a$ cents and $b$ cents stamps, we would make all values of money $\geq x$ Find a value $x$, such that if we had $a$ cents and $b$ cents stamps, we would make all values of money $\geq x$ This is the classic stamp question used for induction, when we have suppose, $4$ cent stamps and $7$ cent stamps, and we want to prove that any amount of postage $n\geq 18$ can be made using these stamps. What I want to know is that if there is a **formula/algorithm** for figuring out the **minimum** amount of cent stamps that can be made? (in this case it is 18) The way I usually do it is by writing down some numbers and then look for the starting pointer, whereon after, all postages can be made. Does such an algorithm exist that would give us the value $n$ we are looking for?

Yes! I'd recommend you try to guess then prove a formula for yourself, but if you get stuck, a solution is here.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy c774fb7da7944d9d984f313a80dd2891