Work it out on paper. You have seven states, {0, 1, ... 6} for the possible remainders. Suppose the machine is in state 4; the remainder is 4. Then it receives the next bit, which is 1. Now what is the remainder? (Answer: 2) You must assign all fourteen of these transition rules.
Try it for n=6. You will see that there is no need for a state 4, since it is identical to one of the other states.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…