I had some time free this afternoon so I thought I'd give this another shot. Given john.c's example input, for 1 <= t < =10000 nothing repeats and I can't see a pattern except that "offset" is linear, but offset growing linearly is not surprising given the input and not helpful. For the less general case, where the pattern does enter a cycle (but the cycle may have a period > 1) , I've amended my solution and it works... but for the more general case where it seems unlikely that the pattern will hit a cycle quite quickly it doesn't work. I have a gut feeling that john.c's input will not repeat/cycle but cannot prove it. The graph for the input john suggested to try is below. It's possible there is a pattern there for the passcode, but what it is... I have no idea. So, for now I'm going to admit defeat. I'd really love to know more about this. Maybe one day
Graph for
Code:
initial state: #........#
36
1152
....#
#....
0
oops... ignore the blue line... that's just t (i.e. same as the x-axis). Didn't mean to add that to the graph
I do find it interesting that the passcode repeats (there probably is a pattern there but I cannot recognise it)
First few passcodes (for that example above)
Code:
9, 18, 18, 27, 18, 27, 36, 27, 18, 36, 36, 54, 36, 45, 72, 27, 18, 36, 36, 54, 36, 54, 72, 54, 36, 72, 72, 108, 72, 81, 144, 27, 18