# Solution to Clusters Back to Round

#### by Anderson Wang and Jon Schneider

### General

There are four Athena (or Minerva, no one can decide on the name!) clusters around campus. Each one requires entering a certain passcode on a numerical keypad to get in, and the passcode itself is always given to you by a person nearby. However, if we try to input the digits, different digits (or even non-digits in one case) show up on the 7-segment display. We need to figure out how the keypads actually operate in order to enter the desired passcode.

This is what the keypad looks like:

### Building 4

This is the first cluster to be unlocked. Outside the door is a person who tells us that the code is **8675309**, that the keypads have recently gotten difficult to use, and that you can press the asterisk to start over.

For this keypad, the first digit you enter always shows up as intended, but subsequent digits are often totally wrong. After some experimentation, we can see that if you first input the digit X and then input Y, the actual digit that shows up is the units digit of X+Y (so if you type in “75”, then “72” actually shows up because 2 is the units digit of 7+5=12). It turns out that whenever you enter a digit, the actual digit that appears is the units digit of the sum of all current displayed digits and your input digit.

So, in order to get 8675309 to show up on a keypad, we must first enter 8, and then another 8 (because 8+8=16), then 3 (because 8+6+3=17), and so on. The full input is “**8834710**”.

### Building 3

The code for this cluster is **5726418**.

For this keypad, each digit performs a certain transformation on the current number and then adds itself to the end. Perhaps one of the clearest examples of this is 8, which reverses the number (and then appends an 8 at the end), so if the current code is “12345” and you input 8, the result is “543218”. With some experimentation, we can figure out what each digit does:

0 | Do nothing (then add a 0 to the end) |

1 | Delete the first digit (then add a 1 to the end) |

2 | Replace each digit X with 9-X (then add a 2 to the end) |

3 | Add 1 to every digit, with 9 turning into 0 (then add a 3 to the end) |

4 | If there are any consecutive equal digits, remove all but one of them (then add a 4 to the end). For example, “334555” would turn into “3454”. |

5 | Move the first digit to the end (then add a 5 to the end) |

6 | Change every digit to a 6 (then add a 6 to the end) |

7 | Replace the current number with the count of lit segments on the seven-segment display (then add a 7 to the end). For example “888” would turn into “217” because “8” has all seven lit segments, so the total number of lit segments is 8*3=21 |

8 | Reverse the number (then add an 8 to the end) |

9 | Delete the last digit (then add a 9 to the end). This is the same as replacing the last digit with a 9. |

In order to input 5726418, we can go backwards from the end. Because the last digit of this code is 8, the last digit we type in also has to be 8 (because every number adds itself to the end), so the code right before that has to be 146275. Then, the second-to-last digit we type in has to be 5, and the code right before that has to be 71462. Then we must have typed a 2, and the code before that has to be 2853. And then the code before typing in a 3 has to be 174.

From here we have a little more freedom, because the code before typing in the 4 could be any of “17”, “117”, “177”, “1177”, etc. The one tricky thing is that “17” is actually impossible to get, because there is no digit with only 1 lit segment. There are many possible ways to achieve this: for example, “84” has 11 lit segments, so one potential solution is “**84743258**”.

### Building 10

We are told that the code is **PEACHES**, in upper-case.

For this keypad, inputting a digit toggles all of the corresponding segments of that digit in the display. So, for example, inputting 0 will make the display read 0, and inputting a 0 again turns the display empty again because it toggles all the same segments. Inputting 0, then 1, makes the display a capital “C”, because the two rightmost segments (the ones that make up “1”) are toggled off in the “0”. Equivalently, the segments are XORed with the existing segments.

The “active” digit can be shifted to the right by pressing the pound symbol (i.e. at the beginning all inputted digits only affect the first slot on the display, and then if you press pound, it will affect the second slot, and so on).

We can determine how to make each letter in “PEACHES” either by trial and error, or more systematically by coming up with a sequence of digits that achieves each individual segment. For example, you can immediately get the middle segment with “80”, the bottom-left segment with “89”, and the top-right segment with “86”. Then you can get the top-left segment by noting that “83” gives you both the bottom-left and top-left segments, but we already know that “89” gives just the bottom-left segment, so we can get just the top-left segment with “8389” (or equivalently, just “39”).

One possible solution is “**013678#18#037#01#489#18#5**”.

### Building 1

The code for this cluster is **201608**.

Playing around, we notice that inputs generally happen in pairs: if we input two digits that sum to less than 10 then it will display their sum, and if we continue typing in pairs of digits that sum to less than 10, the previous pair sums get pushed to the left, showing at most 3 at a time. Here is a sample sequence of inputs:

Input | Result |
---|---|

4 | 04 |

3 | 07 |

4 | 0704 |

1 | 0705 |

8 | 070508 |

1 | 070509 |

2 | 050902 |

6 | 050908 |

Additionally, if the pair of digits sums to greater than 10, then the code immediately resets to blank, suggesting that’s not allowed for some reason. However, if the sum is exactly 10, the behavior is a little weird: it will display 10, but upon entering the next digit, that digit also gets added to the 10. For example, if you type in 64 the display will say “10”, and then typing 7 will result in “1707” (and then typing 1 will give “1708”).

Finally, if we press the pound sign, the display will also say “10”, but the next *two* inputted digits also get added to it.

From this information, we can realize that this is a game of bowling, where inputting digits counts as hitting that many pins, and the pound sign is a strike. The display shows the point values of each of three consecutive frames, which is why getting a spare or strike causes future inputs to get added to the 10.

To achieve 201608, we note that the second frame (16) can only be from a spare, and in particular we need 6+2 points in the third frame, so that the 6 is added to the second frame. This implies that the first frame (20) has to be a strike, where you get 10 points plus 10 more for the spare on the second frame. One sequence of inputs representing this is “**#4662**”, but anything with a spare on the second frame works.