The number of buttons has the form 12k+5. 3, 4 and 6 are factors of 12, so 12k is a multiple of each of them, and only the 5 extra buttons decide the leftover.
- Cards of 3: 5=3+2, so 12k+5=3(4k+1)+2. Always 2 left over.
- Cards of 4: 5=4+1, so 12k+5=4(3k+1)+1. Always 1 left over.
- Cards of 6: 5 is less than 6, so always 5 left over.
Cards of 24: 24 is not a factor of 12, so the leftover is not always the same. 29=12×2+5 leaves 29−24=5 over, but 17=12+5 leaves 17 over (it does not even fill one card). So the leftover is sometimes 5 and sometimes 17.