If $\alpha,\beta,\gamma$ are the roots of equation $x^3-7x^2+12x-11=0$, find the last four digits of $\alpha^{21007}+\beta^{21007}+\gamma^{21007}$ 
If $\alpha,\beta,\gamma$ are roots of the equation $x^3-7x^2+12x-11=0$, then find the last four digits of $\alpha^{21007}+\beta^{21007}+\gamma^{21007}$.

I know that $\alpha+\beta+\gamma=7, \alpha\beta+\beta\gamma+\gamma\alpha=12,\alpha\beta\gamma=11$. From this how I can proceed. please give some idea
 A: Let $z_i = \alpha^i + \beta^i + \gamma^i$
It's easy to check that $z_0 = 3, z_1 = 7, z_2 = 25$ etc.
Our objective is to compute $z_{21007} \bmod 10000$
Consider the sequence of rational integers $3, 7, 25, \ldots$
and the corresponding recurrence relation $$z_{n+3} - 7z_{n+2} + 12z_{n+1} - 11z_n = 0$$
We'll find the periodicity of the above sequence modulo $10000 = 2^4 5^4$
We'll do it in $3$ steps and need $3$ theorems (viz., Theorems $2, 8, 10$) from On sequences defined by linear recurrence relations  by H. T. Engstrom
$1.$ Find the periodicity modulo $2$ and modulo $5$ (See Theorem $2$)
Consider $$F(z) = z^3 - 7z^2 + 12z - 11 = 0$$
Or, $$F(z) \bmod 2 = (z^3 + z^2 + 1) \bmod 2$$
and  $$F(z) \bmod 5 = (z^3 + 3z^2 + 2z + 4) \bmod 5 = (z+4)(z^2+4z+1) \bmod 5$$
The period of the sequence modulo $2$ is $2^3-1 = 7$
and the period of the sequence modulo $5$ is $LCM(5^1-1, 5^2-1) = 24$
$2.$ Find the periodicity modulo $2^4$ and modulo $5^4$ (See Theorem $8$)
The period of the sequence modulo $2^4$ is $2^{4-1}.7 = 56$
and the period of the sequence modulo $5^4$ is $5^{4-1}.24 = 3000$
$3.$ Find the periodicity modulo $2^4 5^4$ (See Theorem $10$)
Finally the period of the sequence modulo $2^4 5^4$ is $LCM(56, 3000) = 21000$
The final step is to observe that $$z_{21007} \bmod 10000 = z_{21007 \bmod 21000} \bmod 10000 = z_7 \bmod 10000 = 4637$$
A: This turned out to be interesting. If we let $x_n = \alpha^n + \beta^n + \gamma^n\bmod 10000,$ then one easily has the recurrence:
$$x_{n+3} = 7x_{n+2} - 12x_{n+1} + 11x_{n}$$
with $x_0 = 3, x_1 = 7, x_2 = 25.$ The idea is obviously to find the period of the sequence $\{x_n\},$ which turns out to be $T = 21000$, after a short Python simulation. This gives the answer:
$$x_{21007} = 4637.$$
For reference, the indices $n\leq 21007$ for which we get the same four digits are:
[    7,    11,  2261,  3007,  3761,  5257,  5261,  7511,  8257,
   10507, 10511, 12761, 13507, 15757, 15761, 17257, 18011, 18757,
   21007]

I will be eagerly waiting for an analytic solution but it looks to be beyond the elementary methods that usually tackle this kind of problems. Something to be consider would be maybe an extenstion of Euler/Fermat theorems for complex primes but I am not well-versed in that area.
A: COMMENT.-You have to apply Newton's identities giving relations between the polynomials $p_k=x^k+y^k+z^k$ where $x,y,z$ are the roots of your cubic equation (your $\alpha,\beta,\gamma$) and the corresponding elementary simmetric polynomials $e_0=1,e_1=x+y+z=7,e_2=xy+xz+yz=12$ and $e_3=xyz=11$ ($e_n=0$ for all $n\gt3$).
You have the formulae
$$p_1=e_1\\p_2=e_1^2-2e_2\\p_3=e_1^3-3e_1e_2+3e_3\\p_4=e_1^4-4e_1^2e_2+4e_1e_3+2e_2^2-4e_4\\.....................\\.....................\\p_k=(-1)^{k-1}ke_k+\Sigma_{i=1}^{k-1}(-1)^{k-1+i}e_{k-i}p_i$$ I give you the calculation till $p_5$. Surely a certain periodicity must be found between the first few quantities at stake (otherwise it would be impossible to find an answer by this means). My intention is only to help you in your problem but not to find the solution. You have
$$p_1=7\\p_2=25\\p_3=124\\p_4=645\\p_5=3027$$
