* fix: clean-up Project Euler 121-140 * fix: corrections from review Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> * fix: missing backticks Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com> * fix: corrections from review Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> * fix: missing delimiter Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
45 lines
1000 B
Markdown
45 lines
1000 B
Markdown
---
|
|
id: 5900f3ef1000cf542c50ff01
|
|
title: 'Problem 129: Repunit divisibility'
|
|
challengeType: 5
|
|
forumTopicId: 301756
|
|
dashedName: problem-129-repunit-divisibility
|
|
---
|
|
|
|
# --description--
|
|
|
|
A number consisting entirely of ones is called a repunit. We shall define $R(k)$ to be a repunit of length $k$; for example, $R(6) = 111111$.
|
|
|
|
Given that $n$ is a positive integer and $GCD(n, 10) = 1$, it can be shown that there always exists a value, $k$, for which $R(k)$ is divisible by $n$, and let $A(n)$ be the least such value of $k$; for example, $A(7) = 6$ and $A(41) = 5$.
|
|
|
|
The least value of $n$ for which $A(n)$ first exceeds ten is 17.
|
|
|
|
Find the least value of $n$ for which $A(n)$ first exceeds one-million.
|
|
|
|
# --hints--
|
|
|
|
`repunitDivisibility()` should return `1000023`.
|
|
|
|
```js
|
|
assert.strictEqual(repunitDivisibility(), 1000023);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
function repunitDivisibility() {
|
|
|
|
return true;
|
|
}
|
|
|
|
repunitDivisibility();
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
// solution required
|
|
```
|