Problem

Source: 2018 Singapore Mathematical Olympiad Senior Q5

Tags: combinatorics



Starting with any n-tuple R0, n1, of symbols from A,B,C, we define a sequence R0,R1,R2,, according to the following rule: If Rj=(x1,x2,,xn), then Rj+1=(y1,y2,,yn), where yi=xi if xi=xi+1 (taking xn+1=x1) and yi is the symbol other than xi,xi+1 if xixi+1. Find all positive integers n>1 for which there exists some integer m>0 such that Rm=R0.