Well I realized I do not need every permutation, I do only need any combination of the min max values lets have alook at the followin example lets say I do have the intervals "A - B", "C - D" and "E - F" now I do want to get any min max combination (because I do want to use this for an addfunction there is no different if lets say A is in first, second or third place. Meaning e.g. ACE = CEA = EAC etc. Therefor I do only need ACE, ACF, ADE, ADF, BCE, BCF, BDE and BDF. Every other combination is not needed because plus is commutativ (see above) If you do have a look at this with it's index then you might realice there is every bitcombination in it. Because lets say the minimum is 0 and the maximum is 1 in indexing then you do get 000 up to 111. And that's what I do want to realize for "length" 2 to 10 (or even higher). Well I could use 2, 3 ... loops in loops but well in the beginning I do not know how many are needed. Well maybe I should try to think about a bitmap using an array doing something like if most right position in array is 0 then set it to 1, if it is already 1 then set it to 0 and increase the next position. if this is already 1 then increase the next and set this to 0 etc. :^) meaning 000 +1 => 001 001 + 1=> 010 .... 011 +1 => 100 ... Does anyone of you know a better solution for this? If so please let me know! Because in my example I have to check the bitarray and this task gets bigger for every combination, which is not a good idea concerning performance. :) Thanks! Stephan.