- All Contests
- ProjectEuler+
- Project Euler #130: Composites with prime repunit property

# Project Euler #130: Composites with prime repunit property

# Project Euler #130: Composites with prime repunit property

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

A number consisting entirely of ones is called a repunit. We shall define to be a repunit of length ; for example, .

Given that is a positive integer and , it can be shown that there always exists a value, , for which is divisible by , and let be the least such value of ; for example, and .

You are given that for all primes, , that is divisible by . For example, when , , and is divisible by .

However, there are rare composite values for which this is also true; the first five examples being , , , , and .

Given and , print all composite values in the interval for which and is divisible by .

**Input Format**

The input contains consists of one line containing two integers and separated by a space.

**Constraints**

In files #01-#05:

In files #06-#10:

In files #11-#25:

**Output Format**

Output all composite values in the interval for which and is divisible by , each in a single line.

**Sample Input**

```
2 1000
```

**Sample Output**

```
91
259
451
481
703
```

**Explanation**

and 90 is divisible by 6.