Tuples Tuples[list, n] all possible tuples of list of length n. Attributes[Tuples] := {Protected} Simple examples In[1]:= Tuples[Range[1, 3], 2] Out[1]= {{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}