I can easily make counter for consecutive numbers. But for patterns, described in below question, I'm quite unsure about my approach.
Question - We want to design a synchronous counter that counts the sequence $0−1−0−2−0−3$ and then repeats. The minimum number of $J-K$ flip-flops required to implement this counter is _____________ ?
My approach - Make counter using 3 flip flops using some gates. The counting sequence $(ABC)$ would be $000, 001, 100, 010, 110, 011$ and at any state if $Y = A'B'C' + AC'$ is true output $0$, else output the current state value.
Is this approach correct? If it's not, what's the correct approach to make counters for this kind of irregular patterns?