project-euler

Distinct primes factors

Problem Description

The first two consecutive numbers to have two distinct prime factors are:

14 = 2 x 7
15 = 3 x 5

The first three consecutive numbers to have three distinct prime factors are:

644 = 2² x 7 x 23
645 = 3 x 5 x 43
646 = 2 x 17 x 19.

Find the first four consecutive integers to have four distinct prime factors each. What is the first of these numbers?

Performance

Try it online!

Real time: 33.148 s
User time: 32.719 s
Sys. time: 0.214 s
CPU share: 99.35 %
Exit code: 0