← RoseCode

ROSECODE 004

Distant Twin Primes

elasolova · Programming ·

The pair 3,5 is special as it is the first prime pair to have difference of two. (Twin primes) After this, comes pair 5,7. The distance between these two pairs is 2 as it is calculated by subtracting the first member of each pair. Under 100, the pair 59,61 has the longest length from such previous pair 41,43 with the distance of 18.

Find longest distance of such prime pair, each member below one million, from such previous pair.