For example, the pattern 531 would produce formula_9 or formula_10. Since the pattern 531 has a period of 3, The results from the previous example would produce formula_11or formula_12. In this case, 531 is valid since the numbers formula_12 are all unique. Another example, 513 is an invalid pattern because the first step produces formula_14 or formula_15, the second step produces formula_16 or formula_17, and the final sequence contains at least a duplicate of one number, in this case a 2.