2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f52c1000cf542c51003e
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 447: Retractions C'
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
2018-10-08 00:01:53 +00:00
|
|
|
For every integer n>1, the family of functions fn,a,b is defined
|
2018-09-30 22:01:58 +00:00
|
|
|
by fn,a,b(x)≡ax+b mod n for a,b,x integer and 0<a<n, 0≤b<n, 0≤x<n.
|
|
|
|
We will call fn,a,b a retraction if fn,a,b(fn,a,b(x))≡fn,a,b(x) mod n for every 0≤x<n.
|
|
|
|
Let R(n) be the number of retractions for n.
|
|
|
|
|
|
|
|
|
|
|
|
F(N)=∑R(n) for 2≤n≤N.
|
|
|
|
F(107)≡638042271 (mod 1 000 000 007).
|
|
|
|
|
|
|
|
|
|
|
|
Find F(1014) (mod 1 000 000 007).
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
tests:
|
|
|
|
- text: <code>euler447()</code> should return 530553372.
|
2018-10-08 00:01:53 +00:00
|
|
|
testString: 'assert.strictEqual(euler447(), 530553372, "<code>euler447()</code> should return 530553372.");'
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler447() {
|
|
|
|
// Good luck!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler447();
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
|
|
|
</section>
|