Unique Gaps is based on the total number of unique gaps between the numbers in a combination. The majority of the possible drawings have the most unique gaps, so it is useful to eliminate the lower values using the Unique Gaps filter that is available in Filtering Full Wheel Generator.

The unique gap score for a combination is calculated by counting the gaps between each pair of numbers in the combination ignoring any gaps that were already counted. The majority of possible combinations have high gap scores. A combination like 01-02-03-04-05-06 would have the lowest score possible (a zero) for a pick-6 combination but any combination that had the same gap between each number would have the same score. In a 6/53 lottery with 22.9 million combinations, there are only 252 combinations that have a gap score of zero so you certainly would not want to play those combinations.

To show how this score is calculated, for the combination 07-16-24-39-49-53 the gaps would be:

16-07 = 9
24-07 = 17
39-07 = 32
49-07 = 42
53-07 = 46
24-16 = 8
39-16 = 23
49-16 = 33
53-16 = 37
39-24 = 15
49-24 = 25
53-24 = 29
49-39 = 10
53-39 = 13
53-49 = 4

The unique gaps are 4, 8, 9, 10, 13, 15, 17, 23, 25, 29, 32, 33, 37, 42, 46. This combination has 15 unique gaps (the most it can have for a pick-6) but we adjust it by 5 in the case of pick-6 lotteries (the number of gaps between the lowest and highest numbers in a combination) so that the actual score would be 15 - 5 = 10. If we didn't adjust this, the lowest score would be 5 for a pick-6. This adjustment makes zero the lowest score for any pick-size and makes it easier to compare. Obviously this is not a calculation that is convenient to compute by hand.

print answer