A block of consecutive integers is split into sets by the procedure below.
You are given the interval of integers to work on and an integer P. At the start, every integer in the interval belongs to a separate set that holds only that integer. Then, for every pair of integers in the interval, if the two integers have a common prime factor that is at least P, the two sets holding them are merged into one set.
How many sets are there when the procedure ends?