The language isn't a concern here, I'm trying to figure out how to go about this logically. Let say I have an array: [A] [C] [D] [E]...etc..etc.. with top limits. How would you go about finding all variations of this array provided all of the arrays stay in order. ie: [A] [C] [D] [A] [C] [A] [A] [C] [D] [E] [A] [D] [E] [A] [E] [A] [E] [A] [D] [E] [A] [C] [D] [E] etc. etc. Like I said I'm not looking for programming examples, just concepts on how to go about this.

Set case [A] (only one entry in the array) equal to 1 The rest can be calculated from the number (n) of entries in the array by the equation: 2*(n-1)^2 - 2*(n-1) + 3