You are breaking into a vault that contains ancient Roman treasure. The vault is locked, and can be opened via a modern-day keypad. The keypad contains three numerical inputs, which are (of course) expressed using Roman numerals: “I,” “II,” and “III.”
It’s a good thing your accomplice was able to steal the numerical key code to the vault. Earlier in the day, they handed you this code on a scroll of paper. Once at the keypad, you remove the scroll from your pocket and unfurl it. It reads: “IIIIIIIIII.” That’s ten vertical marks, without any clear spacing between them.
With some quick mental arithmetic, you realize the combination to unlock the door could be anywhere from four digits long to 10 digits long. (Or is it IV digits to X digits?) How many distinct combinations are possible? If two combinations use the same numbers but in a different order, they are considered distinct.
I created code with a recursive function that did the following, given a string of $n$ Is :
The total number of combinations is
$$\boxed{274}$$The sequence of number of distinct combinations of $n$ Is is a shift of Tribonacci Numbers.
Having successfully hacked your way through the first keypad, the door opens to reveal a second door with yet another keypad that has eight numerical inputs: “I,” “II,” “III,” “IV,” “V,” “VI,” “VII,” and “VIII.”
You were expecting this, which is why your accomplice had handed you a second scroll of paper. You unfurl this one as well, hoping they remembered to add spaces between the numbers.
No such luck. This paper reads: “IIIVIIIVIIIVIII.” That’s 15 characters in total. How many distinct combinations are possible for this second door?
I created code with a recursive function that did the following, given a string S of a random combination of Is and Vs :
The total number of combinations is
$$\boxed{4000}$$The distribution is symmetric:
I also found the following fascinating: