Well, look at it this way. Consider a 2 digit number. Consider also that you are allowing digits 0 thru 9. The number of possibilities are 100. 10[sup]2[/sup]. The 2 goes with the number of slots. If you have 3 slots, you have the 10[sup]3[/sup], 000 thru 999.
If you have 3 slots and only two things to put in them, you have the following combinations: 000, 001, 010, 011, 100, 101, 110, and 111. That's 8 or 2 (the number of items) raised to the 3 (the number of slots) or 2[sup]3[/sup].
If you have 2 slots and 3 items: You get 00, 01, 02, 10, 11, 12, 20, 21, and 22. That's 9 or 3[sup]2[/sup]. In the case of 3, 4, 5: 33, 34, 35, 43, 44, 45, 53, 54, 55. I'll leave it as an exercise (

) to find the 27 values for 3, 4, and 5 in three slots.
But, yeah, 10 slots with 3 items ... 3[sup]10[/sup].