We are given that there are 5 groups which are:
group of 2
group of 3
group of 4
group of 5
group of 6
and 1 left over
So the smallest number of cupcakes would simply be the sum of all:
smallest number of cupcakes = 2 + 3 + 4 + 5 + 6 + 1
smallest number of cupcakes = 21