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--
|
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
Let $f(n) = n^2 - 3n - 1$.
|
2020-11-27 18:02:05 +00:00
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
Let $p$ be a prime.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
Let $R(p)$ be the smallest positive integer $n$ such that $f(n)\bmod p^2 = 0$ if such an integer $n$ exists, otherwise $R(p) = 0$.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
Let $SR(L)$ be $\sum R(p)$ for all primes not exceeding $L$.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
Find $SR({10}^7)$.
|
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-30 15:20:31 +00:00
|
|
|
`polynomialModuloSquareOfPrime()` should return `2647787126797397000`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
2021-07-30 15:20:31 +00:00
|
|
|
assert.strictEqual(polynomialModuloSquareOfPrime(), 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
|
2021-07-30 15:20:31 +00:00
|
|
|
function polynomialModuloSquareOfPrime() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-30 15:20:31 +00:00
|
|
|
polynomialModuloSquareOfPrime();
|
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
|
|
|
|
```
|