You are given an interval of consecutive integers. You want to group these integers into sets.
You are given the interval and an integer P. At the start, each integer in the interval sits in a set of its own.
Then you consider every pair of integers in the interval. If the two integers share a prime factor that is at least P, you merge the two sets the integers belong to.
How many sets are left when this process is finished?