If
and
are roots to the equation
What is the last three digits of ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We first try to evaluate α 2 n + β 2 n for small n to determine a pattern
It's trivial by Vieta's formula that α + β = 1 , α β = − 3
Let a n = α 2 n + β 2 n , then a 0 = 1
a 1 = α 2 1 + β 2 1 = ( α + β ) 2 − 2 ( α β ) = 1 2 − 2 ( − 3 ) = 7
a 2 = α 2 2 + β 2 2 = ( α 2 + β 2 ) 2 − 2 ( α β ) 2 = 7 2 − 2 ( − 3 ) 2 = 3 1
a 3 = α 2 3 + β 2 3 = ( α 4 + β 4 ) 2 − 2 ( α β ) 4 = 3 1 2 − 2 ( − 3 ) 4 = 7 9 9
It become obvious that we have a recurrence relation a 0 = 1 , a 1 = 7 , and for n = 2 , 3 , 4 , … that a n = ( a n − 1 ) 2 − 2 ⋅ 3 2 n − 1
Since we're only interested in the last three digits, we find modulo 1 0 0 0 , that is a n = ( ( a n − 1 ) 2 − 2 ⋅ 3 2 n − 1 ) m o d 1 0 0 0
Notice that there is a term raised to the power of another power, so we can simplify the calculation by appealing to Euler Totient Function because gcd ( 3 , 1 0 0 0 ) = 1 , thus ϕ ( 1 0 0 0 ) = 1 0 0 0 ( 1 − 2 1 ) ( 1 − 5 1 ) = 4 0 0 , we augment a n to
a n = ( ( a n − 1 ) 2 − 2 ⋅ 3 2 n − 1 m o d 4 0 0 ) m o d 1 0 0 0
By python
Output