Largest roots of cubic polynomials

Published on Saturday, 29th October 2011, 01:00 pm; Solved by 467;
Difficulty rating: 60%

Problem 356

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 \limits_{i = 1}^{30} {\left \lfloor a_i^{987654321} \right \rfloor}$.

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