2018-09-30 22:01:58 +00:00
---
id: 5900f54b1000cf542c51005d
title: 'Problem 479: Roots on the Rise'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 302156
2021-01-13 02:31:00 +00:00
dashedName: problem-479-roots-on-the-rise
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2021-07-30 15:32:21 +00:00
Let $a_k$, $b_k$, and $c_k$ represent the three solutions (real or complex numbers) to the expression $\frac{1}{x} = {\left(\frac{k}{x} \right)}^2 (k + x^2) - kx$.
2018-09-30 22:01:58 +00:00
2021-07-30 15:32:21 +00:00
For instance, for $k = 5$, we see that $\\{a_5, b_5, c_5\\}$ is approximately $\\{5.727244, -0.363622 + 2.057397i, -0.363622 - 2.057397i\\}$.
2018-09-30 22:01:58 +00:00
2021-07-30 15:32:21 +00:00
Let $S(n) = \displaystyle\sum_{p = 1}^n \sum_{k = 1}^n {(a_k + b_k)}^p {(b_k + c_k)}^p {(c_k + a_k)}^p$ for all integers $p$, $k$ such that $1 ≤ p, k ≤ n$.
2018-09-30 22:01:58 +00:00
2021-07-30 15:32:21 +00:00
Interestingly, $S(n)$ is always an integer. For example, $S(4) = 51\\,160$.
2018-09-30 22:01:58 +00:00
2021-07-30 15:32:21 +00:00
Find $S({10}^6) \text{ modulo } 1\\,000\\,000\\,007$.
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:32:21 +00:00
`rootsOnTheRise()` should return `191541795` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-07-30 15:32:21 +00:00
assert.strictEqual(rootsOnTheRise(), 191541795);
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:32:21 +00:00
function rootsOnTheRise() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-07-30 15:32:21 +00:00
rootsOnTheRise();
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
```