We want to minimise the total number of coins under these conditions:
7 pockets, each has at least 1 coin
At most 3 pockets can have the same number of coins
The remaining pockets must all have distinct numbers
To minimise total coins: we can use the smallest possible positive integers and allow exactly 3 pockets to have the same number (since “at most 3” → we use 3 to minimise total). The other 4 pockets must all be distinct and different from the repeated number.
Let the repeated number be 1 (smallest possible): so 3 pockets: 1, 1, 1
Now choose 4 distinct numbers, all different from 1: Next smallest distinct numbers: 2, 3, 4, 5
Hence, Total coins: 1 + 1 + 1 + 2 + 3 + 4 + 5 = 17