Factor a partial calculation function to calculate prime

The methods for calculating the prime number is too big and long, so to make the code more understandable, a private partial function named partialCaculation will be extracted from the original code. This function takes primeNumber and Boolean notPrimes array as input and the output is an integer prime number