Changed from int to unsinged long when computing number of n-tuples to check.