*Thank you to Isaac for sending in this solution to Pennies and Tuppences.*

Ways(

*m*) = (*n*+ (*m*–*n*(mod*m*)) +*m*)/*m*

This works for coins of 1 pence and

*m*pence, where*n*is the amount of money for which you are trying to find the amount of money.

This works because for any way to make

*x*pence, you can add a 1 to it and get a way to make*x*+1 pence and the amount of ways to make*x*doesn’t increase at all, but if*x*is a multiple of*m*, a possible way to make*x*is simply*m*, so the possible ways of making*x*increases by one, so all numbers between two multiples of*m*, including the lower multiple, have the same amount of ways to create them, which is equal to the next multiple of*m*divided by*m*, because everything up to the first multiple of*m*can be made in one way – adding 1s together, then everything from that multiple of*m*to the next one can be made by 1s, or 1s and an*m*, giving one extra way. Up to the first multiple of*m*, there is one way, which is the first multiple of*m*divided by*m*, so, as every time you go past a multiple of*m*, you add another way, the way of making each number is the next multiple of*m*divided by*m*.

In my formula, the (m – n (mod m)) part creates a number, which when added to

*n*, brings it up to the next multiple of*m*.*m*is added to this result, which takes it up to the next multiple of*m*. Finally, the whole result is divided by*m*to create the amount of ways.Response to: