in how many ways can you have coins that total exactly 18pence using 1p, 2p, 5p and 10p coins but you may wish to use as many of each sort as you wish.
Start with the biggest coin, then the next biggest, etc. This is so that you always end up adding on just single coins of 1p.
10 we can only have 1*10 because 2*10 is greater than 18.
10 + 5 we can only add on 1*5 because adding on 2*5 will make the sum greater than 18
10 + 5 + 2 again we can only add on 1*2
10 + 5 + 2 + 1 our first arrangement (1*10, 1*5, 1*2, 1*1)
Now we modify the 2p intp 2*1p, the 5p into 2*2p + 1p and the 10 p into 2*5p (as well as 2p's and 1p).
10 + 5 + (1+1) + 1 our 2nd arrangement (1*10, 1*5, 0*2, 3*1)
Now modify the 5, in the 1st arrangement.
10 + (2+2+1) + 2 + 1 3rd arrangement (1*10, 0*5, 3*2, 2*1)
10 + (2+2+1) + (1+1) + 1 etc. (1*10, 0*5, 2*2, 4*1)
10 + (2+(1+1)+1) + (1+1) + 1 etc. (1*10, 1*5, 1*2, 1*1)
10 + ((1+1)+(1+1)+1) + (1+1) + 1 (1*10, 0*5, 0*2, 8*1)
Now modify the 10, in the 1st arrangement.
(5+5) + 5 + 2 + 1 our 7th arrangement (0*10, 3*5, 1*2, 1*1)
(5+5) + 5 + (1+1) + 1 (0*10, 3*5, 0*2, 3*1)
(5+5) + (2+2+1) + (1+1) + 1 (0*10, 2*5, 2*2, 4*1)
(5+5) + (2+(1+1)+1) + (1+1) + 1 (0*10, 2*5, 1*2, 6*1)
(5+5) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 2*5, 0*2, 8*1) -- 11th arrangment
(5+(2+2+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 1*5, 2*2, 9*1)
(5+(2+(1+1)+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 1*5, 1*2, 11*1)
(5+((1+1)+(1+1)+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 1*5, 0*2, 13*1) --- 14th arrangememt
((2+2+1)+((1+1)+(1+1)+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 0*5, 2*2, 14*1)
((2+(1+1)+1)+((1+1)+(1+1)+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 0*5, 1*2, 16*1)
(((1+1)+(1+1)+1)+((1+1)+(1+1)+1)) + ((1+1)+(1+1)+1) + (1+1) + 1 (0*10, 0*5, 0*2, 18*1) --17th arrangement
So, in total there are 17 arrangements of 1p, 2p, 5p and 10p coins to give 18p