2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4151000cf542c50ff27
|
|
|
|
|
title: 'Problem 168: Number Rotations'
|
2020-11-27 18:02:05 +00:00
|
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
|
forumTopicId: 301802
|
2021-01-13 02:31:00 +00:00
|
|
|
|
dashedName: problem-168-number-rotations
|
2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
# --description--
|
|
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
|
Consider the number 142857. We can right-rotate this number by moving the last digit (7) to the front of it, giving us 714285.
|
2020-11-27 18:02:05 +00:00
|
|
|
|
|
2021-07-12 14:19:03 +00:00
|
|
|
|
It can be verified that $714285 = 5 × 142857$.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
This demonstrates an unusual property of 142857: it is a divisor of its right-rotation.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2021-07-12 14:19:03 +00:00
|
|
|
|
Find the last 5 digits of the sum of all integers $n$, $10 < n < 10100$, that have this property.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2021-07-12 14:19:03 +00:00
|
|
|
|
`numberRotations()` should return `59206`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
```js
|
2021-07-12 14:19:03 +00:00
|
|
|
|
assert.strictEqual(numberRotations(), 59206);
|
2018-09-30 22:01:58 +00:00
|
|
|
|
```
|
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2021-07-12 14:19:03 +00:00
|
|
|
|
function numberRotations() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-12 14:19:03 +00:00
|
|
|
|
numberRotations();
|
2018-09-30 22:01:58 +00:00
|
|
|
|
```
|
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|