This is the solution that I found personally to the project. It is not optimized and does not read from the file, but requests user inputs. The first value in the file is the number of primes in the P-divisible set, the second value is the maximum number to test until, and the values on individual lines represent the P-divisible primes.