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 .
The least value of for which first exceeds ten is .
Find the least value of for which first exceeds one-million.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.