problem 356 // project euler



Largest roots of cubic polynomials

Let an be the largest real root of a polynomial g(x) = x3 - 2n·x2 + n.
For example, a2 = 3.86619826…

Find the last eight digits of $sum^{30}_{i=1} lfloor a_i^{987654321} rfloor$.

Note: $lfloor a rfloor$ represents the floor function.


三次多项式的最大根

记an为多项式g(x) = x3 - 2n·x2 + n的最大实根。
例如,a2 = 3.86619826…

求$sum^{30}_{i=1} lfloor a_i^{987654321} rfloor$的最后8位数字。

:$lfloor a rfloor$表示下取整函数。