I've invented an interesting puzzle involving trinary digits (trits).
I was looking into unary operators, which is a function that takes a trit and maps it to another trit value. I found that there are 27 unique operators. For example, one operator (that I call 'Up') changes 0 -> 1, 1 -> 2, and 2 -> 0. Another operator ('toBinary') maps 0 -> 0, 1 -> 1, and 2 -> 1. For convenience I enumerate the operators by a code that tells me what each value would be mapped to, so 'Up' would be 120, and 'toBinary' is 011. Because there are three possible input values (0, 1, or 2), and three possible results for each input value, that means there are 3 to the 3rd power number of possible operators, which is where I get the number 27.
Operators can also work in sequence. So applying 'Up' and then 'toBinary' gives another result that is equivalent to one of the other operators, in this case 110. I wondered how few operators are needed if I could string them together to get all the others. Turns out I only need three. The problem is that to get the equivalent of all the operators, I need to apply those three up to a sequence of five in a row.
To reduce the length of the largest sequences I need to add a fourth operator to my minimalist set. I came across a combination of four that came very close to only needing a sequence of three in a row, only one operator required four in a row. So now I'm wondering if I just picked the wrong 4. Maybe there's another combination of four operators that gets the equivalent of all 27 operators with a maximum of 3 operators in sequence.
So now i'm writing a python program to go through all the combinations to find out.