Thank you. I will be experimenting with everyone’s suggestions. For what it is worth I am calculating the geometric product of two bases in a geometric algebra. This requires reducing the integer list to normal order using certain rules. Each entry in the list refers to a basis vector in the algebra. For example [1,3,2] => exezey and [1] => ex, etc… The basis vectors are not necessarily orthogonal.