Diabolical Combination Lock

A diabolical combination lock has \(n\) dials (each with \(c\) possible states), where \(n,c > 1\). The dials are initially set to states \(d_1,d_2,\dots,d_n\), where \(0\le d_i \lt c\) for each \(1\le i\le n\). Unfortunately, the actual states of the dials (the \(d_i\)'s) are concealed, and the initial settings of the dials are also unknown. On a given turn, one may request that each dial is advanced by an integer amount \(a_i\), but before the dials are advanced, the combination lock is rotated by an (unknown) integer amount (\(r_t\)). That is, the new state of the dials at the end of the turn is \[d_i' := d_{(i+r_t \mod n)} + a_i \mod c\] for each \(1\le i\le n\). After each turn, the lock opens if and only if all of the dials are set to the zero state; otherwise, the game continues.

For which combinations of \(n\) and \(c\) can the lock be always opened, regardless of the choices of the initial configuration and the choices of \(r_t\) (which may vary from turn to turn)?

Play the Game