|
|
Is it as simple as adding an if statement "if(primesList[j] - i == 2)"? |
Is i always the last prime found? |
On the other hand you know that if primesCount is greater than one, the last two elements of primesList are the last two primes found. Taking the difference of those will tell you if they're twin primes. |