Question 943931
The cost, in $, of an item that could be purchased receiving no change is
{{{20a+10b+5c+1d}}} where
{{{a}}} , {{{b}}} , {{{c}}} , and {{{d}}} are {{{0}}} or {{{1}}} .
That means 2 choices for each variable, and
{{{2*2*2*2=2^4=16}}} choices overall.
One of those {{{16}}} choices is {{{0}}} .
I suppose $0 would mean not buying anything,
so if some amount was paid,
it has to be one of the remaining {{{16-1=highlight(15)}}} possible amounts.
 
Now that I know there are 15, I list the amounts,
and count them to make sure I do not forget any:
With a $1 bill ({{{a=1}}} ):
$1,
and if we also add a $5 bill ({{{system(a=1,b=1)}}} ),
$1+$5=$6
$1+$5+$10=$16
$1+$5+$10+$20=$36
$1+$5+$20=$26
With a $1 bill, and a $10 bill, but no $5 bill ({{{system(a=1,b=0,c=1))}}} ),
$1+$10=$11
$1+$10+$20=$31
With a $1 bill, and another bill, but no $5 or $10 bill,
$1+$20=$21
With no $1 bill {{{a=0}}} ), but including one $5 bill ( {{{b=1}}} ):
$5
$5+$10=$15
$5+$10+$20=$35
$5+$20=$25
If no $1 or $5 bill is used ( {{{a=b=0}}} ):
$10
$10+$20=$30
$20