I have the following elements in a list/array
a1,a2,a3
and these elements are used to build another list in a predictable pattern
example
a1,a1,a2,a2,a3,a3,a1,a1,a2,a2,a3,a3...
The pattern may change but I will always know how many times each element repeats and all elements repeats the same number of times. And the elements always show up in the same order.
so another pattern might be
a1,a1,a1,a2,a2,a2,a3,a3,a3,a1,a1,a1,a2,a2,a2,a3,a3,a3...
or
a1,a2,a3,a1,a2,a3
it will never be
a2,a2,a1,a1,a3,a3... or a1,a2,a3,a2,a3,a1 etc
How I determine what element is at any index in the list?