We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #47: Distinct primes factors

# Project Euler #47: Distinct primes factors

# Project Euler #47: Distinct primes factors

_{This problem is a programming version of Problem 47 from projecteuler.net}

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

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

Given find all the consecutive integers, where first integer is to have exactly distinct prime factors. Print the first of these numbers in ascending order.

**Input Format**

Input contains two integers and .

**Output Format**

Print the answer corresponding to the test case. Print each integer in a new line.

**Constraints**

**Sample Input#00**

```
20 2
```

**Sample Output#00**

```
14
20
```

**Sample Input#01**

```
644 3
```

**Sample Output**

```
644
```