## Roots on the Rise

### Problem 479

Let `a`_{k}, `b`_{k}, and `c`_{k} represent the three solutions (real or complex numbers) to the expression 1/`x` = (`k`/`x`)^{2}(`k`+`x`^{2}) - `kx`.

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}.

Let S(`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`.

Interestingly, S(`n`) is always an integer. For example, S(4) = 51160.

Find S(10^{6}) modulo 1 000 000 007.