2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f5361000cf542c510048
|
|
|
|
title: 'Problem 457: A polynomial modulo the square of a prime'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 302131
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-457-a-polynomial-modulo-the-square-of-a-prime
|
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
|
|
|
Let f(n) = n2 - 3n - 1.
|
2020-11-27 18:02:05 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
Let p be a prime.
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
Let R(p) be the smallest positive integer n such that f(n) mod p2 = 0 if such an integer n exists, otherwise R(p) = 0.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
Let SR(L) be ∑R(p) for all primes not exceeding L.
|
|
|
|
|
|
|
|
Find SR(107).
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
`euler457()` should return 2647787126797397000.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
|
|
|
assert.strictEqual(euler457(), 2647787126797397000);
|
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
|
|
|
|
function euler457() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler457();
|
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|