2018-09-30 23:01:58 +01:00
---
id: 5900f4ff1000cf542c510011
title: 'Problem 402: Integer-valued polynomials'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302070
2021-01-13 03:31:00 +01:00
dashedName: problem-402-integer-valued-polynomials
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
It can be shown that the polynomial $n^4 + 4n^3 + 2n^2 + 5n$ is a multiple of 6 for every integer $n$. It can also be shown that 6 is the largest integer satisfying this property.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
Define $M(a, b, c)$ as the maximum $m$ such that $n^4 + an^3 + bn^2 + cn$ is a multiple of $m$ for all integers $n$. For example, $M(4, 2, 5) = 6$.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
Also, define $S(N)$ as the sum of $M(a, b, c)$ for all $0 < a, b, c ≤ N$.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
We can verify that $S(10) = 1\\,972$ and $S(10\\,000) = 2\\,024\\,258\\,331\\,114$.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
Let $F_k$ be the Fibonacci sequence:
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
- $F_0 = 0$, $F_1 = 1$ and
- $F_k = F_{k - 1} + F_{k - 2}$ for $k ≥ 2$.
Find the last 9 digits of $\sum S(F_k)$ for $2 ≤ k ≤ 1\\,234\\,567\\,890\\,123$.
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
`integerValuedPolynomials()` should return `356019862` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-29 19:48:24 +02:00
assert.strictEqual(integerValuedPolynomials(), 356019862);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-29 19:48:24 +02:00
function integerValuedPolynomials() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-29 19:48:24 +02:00
integerValuedPolynomials();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```