A sequence of polynomials g k ( x ) is defined recursively as follows. g 0 ( x ) = x ; g k + 1 ( x ) = g k ( x 2 + 2 x ) − g k ( x ) Find the last three digits of the coefficient of x 2 in g 2 9 9 ( x ) .
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.
This solution is much easier than the intended one (since we intentionally avoided calculus approaches), and all submitted correct solutions followed the same strategy to show that the answer is the last three digits of ( 3 2 9 9 − 1 ) / 2 . This solution, and many others, contains a slight mistake: it is not enough to know 3 2 9 9 − 1 modulo 1 0 0 0 , one needs 2 0 0 0 , because we must eventually divide by 2 (indeed, ( 1 6 6 7 − 1 ) / 2 = 8 3 3 . A few solutions avoided this mistake; some solutions were also rather sketchy.
Consider the recursive polynomials g k ( x ) ,
g 0 ( x ) = x and g k + 1 ( x ) = g k ( x 2 + 2 x ) − g k ( x )
Thus,
g 1 ( x )
= x 2 + 2 x − x
= x 2 + x
Going on,
g 2 ( x )
= g 1 ( x 2 + 2 x ) − g 1 ( x )
= ( x 2 + 2 x ) 2 − x 2 − x by substituting g 1 ( x ) back into the expression previously obtained.
= ... + 4 x 2 + x , where degrees of x greater than 2 can be ignored as it does not affect the coefficient of x 2
Repeat the process for further values of k to obtain the coefficient of x and x 2
g 3 ( x ) = ... + 1 3 x 2 + x
g 4 ( x ) = ... + 4 0 x 2 + x
Hence, observe the pattern for g k ( x ) for coefficient of x 2 that is as follows
g 1 ( x ) -> 2 3 1 − 1 x 2 = x 2
g 2 ( x ) -> 2 3 2 − 1 x 2 = 4 x 2
g 3 ( x ) -> 2 3 3 − 1 x 2 = 1 3 x 2
g 4 ( x ) -> 2 3 4 − 1 x 2 = 4 0 x 2
g k ( x ) -> 2 3 k − 1 x 2
Hence, we need to determine the last 3 digit for 3 2 9 9 to determine the coefficient of x 2 of g 2 9 9 ( x )
The method I use is to use binomial theorem as follows :
3 2 9 9
= 3 . 3 2 9 8
= 3 . 9 1 4 9
= 3 ( 1 0 − 1 ) 1 4 9
= 3 ( ( − 1 ) 1 4 9 + ( 1 4 9 1 ) ( − 1 ) 1 4 8 ( 1 0 ) 1 + ( 1 4 9 2 ) ( − 1 ) 1 4 7 ( 1 0 ) 2 )
= 3 ( − 1 + 1 4 9 0 − 1 1 0 2 6 0 0 )
= − 3 3 3
which also means that the last 3 digit is
= 1 0 0 0 − 3 3 3
= 6 6 7
Hence, reapply the last 3 digits of 3 2 9 9 to the general formula, we get,
g k ( x ) -> 2 3 k − 1 x 2
g 2 9 9 ( x ) -> 2 3 2 9 9 − 1 x 2
= 2 6 6 6 x 2
= 3 3 3 x 2
Thus, the coefficient of x 2 in g 2 9 9 ( x ) is 333.
To get a feel of the recurrence we calculate the first few terms -
g 1 ( x ) = g 0 ( x 2 + 2 x ) − g 0 ( x ) = x 2 + 2 x − x = x 2 + x g 2 ( x ) = ( ( x 2 + 2 x ) 2 + x 2 + 2 x ) − ( x 2 + x ) = x 4 + 4 x 3 + 4 x 2 + x 2 + 2 x − x 2 − x = x 4 + 4 x 3 + 4 x 2 + x
Now we notice that x 3 terms or higher are irrelevant to the x 2 coefficient - they are never reduced down to x 2 or lower terms again, so can have no effect on the coefficient of x 2 . This means we can just look at the recurrence in terms of the x 2 and x terms, casting out any higher terms.
Finding the recurrence and general formula for the x 2 term -
Starting from g k ( x ) = a x 2 + b x + O ( x 3 ) ,
g k + 1 ( x ) = a ( x 2 + 2 x ) 2 + b ( x 2 + 2 x ) − ( a x 2 + b x ) + O ( x 3 ) = a x 4 + 4 a x 3 + 4 a x 2 + b x 2 + 2 b x − a x 2 − b x + O ( x 3 ) = ( 3 a + b ) x 2 + b x + O ( x 3 )
Using a k to refer to the coefficient of x 2 in g k ( x ) , we can write that a k + 1 = 3 a k + b , where b is the coefficient of x in g 0 ( x ) (or any other g k ( x ) , as the recurrence found above tells us it does not change). In this particular case, a k + 1 = 3 a k + 1 .
To turn this into a homogeneous recurrence equation, we note that a k + 2 − 3 a k + 1 = 1 = a k + 1 − 3 a k , so that a k + 2 = 4 a k + 1 − 3 a k .
We now solve this in the usual manner - the characteristic quadratic here is x 2 = 4 x − 3 , x 2 − 4 x + 3 = 0 , ( x − 3 ) ( x − 1 ) = 0 , so a k can be expressed in the form A ( 3 ) k + B ( 1 ) k = A ( 3 ) k + B . Looking at the first two polynomials gives the simultaneous equations
A ( 3 ) 0 + B = A + B = 0 A ( 3 ) 1 + B = 3 A + B = 1 2 A = 1 , A = 2 1 , B = − 2 1
which means that
a k = 2 3 k − 1 .
Finding the last 3 digits of the x 2 coefficient for g 2 9 9 ( x ) -
In particular, the x 2 coefficient in g 2 9 9 ( x ) is 2 3 2 9 9 − 1 . This is impractical to calculate, but this can be mostly avoided in the following manner -
2 3 2 9 9 − 1 = 2 3 3 0 0 − 1 + 2 3 2 9 9 − 3 3 0 0 = 2 3 3 0 0 − 1 + 2 3 2 9 9 ( 1 − 3 ) = 2 3 3 0 0 − 1 − 3 2 9 9
If we now find 2 3 3 0 0 − 1 ( m o d 1 0 0 0 ) , this should make it easier to find 2 3 2 9 9 − 1 ( m o d 1 0 0 0 ) .
Using the generalisation to Fermat's little theorem, that x ϕ ( n ) ≡ 1 ( m o d n ) , we have that 3 1 0 0 ≡ 1 ( m o d 1 2 5 ) , because ϕ ( 1 2 5 ) = 1 2 5 ( 5 4 ) = 1 0 0 . This means 3 3 0 0 ≡ 1 ( m o d 1 2 5 ) .
Then, by simple calculation, we find 3 4 ≡ 9 2 ≡ 1 ( m o d 1 6 ) , so 3 3 0 0 ≡ 1 ( m o d 1 6 ) .
Together these imply 3 3 0 0 ≡ 1 ( m o d 2 0 0 0 ) . This means 3 3 0 0 − 1 ≡ 0 ( m o d 2 0 0 0 ) and 2 3 3 0 0 − 1 ≡ 0 ( m o d 1 0 0 0 ) .
Putting this into the earlier equations, we have that
2 3 2 9 9 − 1 ≡ − 3 2 9 9 ( m o d 1 0 0 0 )
But 3 3 0 0 ≡ 1 ( m o d 1 0 0 0 ) . If we let x = 3 2 9 9 , then 3 x ≡ 1 ( m o d 1 0 0 0 ) . A little consideration throws up x = 6 6 7 as a solution, which is unique because of the uniqueness of multiplicative inverses. Therefore, 3 2 9 9 ≡ 6 6 7 ( m o d 1 0 0 0 ) .
Putting this back in,
2 3 2 9 9 − 1 ≡ − 3 2 9 9 ≡ 1 0 0 0 − 6 6 7 ≡ 3 3 3 ( m o d 1 0 0 0 )
Which means that the last 3 digits of the x 2 coefficient in g 2 9 9 ( x ) are 3 3 3 .
By induction we can easily prove that the coefficient of x^2 in g_{n}(x) is \frac {3^n - 1}{2}
It's easy to check that: 3^20 \equiv 4401 \pmod{10000} Then 3^40 \equiv 8801 \pmod{10000}, 3^60 \equiv 3201 \pmod{10000}, 3^80 \equiv 7601 \pmod{10000}, 3^100 \equiv 2001 \pmod{10000},
Hence 3^300 \equiv 2001 \pmod{10000} Denote 3^300=10000 \times k + 2001 Then k \equiv 0 \pmod{3} Thus 3^299 \equiv 0667 \pmod{10000} Therefore \frac {3^299-1}{2} \equiv 333 \pmod{1000} The answer is 333.
Let the coefficient of x 2 and x in g k ( x ) be defined by the functions m ( k ) and n ( k ) respectively for all positive integers k > 0 . Now we should find the coefficient of x 2 and x in g k ( x 2 + 2 x ) . Note that the term x 2 will occur in the expansion of g k ( x 2 + 2 x ) only in the terms ( x 2 + 2 x ) 2 and x 2 + 2 x , because in all other terms in the expansion of g k ( x 2 + 2 x ) , the power of x will be greater than 2 . Similarly the term x will occur in the expansion of g k ( x 2 + 2 x ) only in the term x 2 + 2 x . Now coefficient of x 2 + 2 x in g k ( x 2 + 2 x ) is n ( k ) , and coefficient of ( x 2 + 2 x ) 2 in g k ( x 2 + 2 x ) is m ( k ) . Since coefficient of x in x 2 + 2 x is 2 , coefficient of x in g k ( x 2 + 2 x ) will be 2 n ( k ) . Again since coefficient of x 2 in x 2 + 2 x is 1 and that in ( x 2 + 2 x ) 2 is 4 , coefficient of x 2 in g k ( x 2 + 2 x ) will be 4 m ( k ) + n ( k ) . Now coefficient of x 2 in g k ( x ) is m ( k ) , and that of x in g k ( x ) is n ( k ) . Thus coefficient of x 2 in g k + 1 ( x ) = 4 m ( k ) + n ( k ) − m ( k ) = 3 m ( k ) + n ( k ) , and coefficient of x in g k + 1 ( x ) = 2 n ( k ) − n ( k ) = n ( k ) . Thus we obtain m ( k + 1 ) = 3 m ( k ) + n ( k ) , n ( k + 1 ) = n ( k ) . Hence we can conclude that n ( k ) is constant. Since n ( 0 ) = 1 , n ( k ) = 1 for all k . Thus m ( k + 1 ) = 3 m ( k ) + 1 . To apply characteristic equation, we should establish a relation between m ( k + 2 ) , m ( k + 1 ) , and m ( k ) . Note that m ( k + 2 ) = 3 m ( k + 1 ) + 1 = 3 m ( k + 1 ) + m ( k + 1 ) − 3 m ( k ) = 4 m ( k + 1 ) − 3 m ( k ) . This implies m ( k + 2 ) − 4 m ( k + 1 ) + 3 m ( k ) = 0 . Hence the characteristic equation of this recurrence relation will be x 2 − 4 x + 3 = 0 . Note that x 2 − 4 x + 3 = ( x − 1 ) ( x − 3 ) . Thus the roots of the characteristic equation will be 1 and 3 . Thus we can conclude that for all k , m ( k ) = p ∗ 1 k + q ∗ 3 k = p + q ∗ 3 k , where p and q are constants. Now the values of p and q have to be found. Note that m ( 0 ) = 0 , so p + q = 0 . . . . . ( 1 ) , and note that m ( 1 ) = 3 m ( 0 ) + 1 = 1 , so p + 3 q = 1 . . . . . ( 2 ) . Subtracting equation 1 from equation 2 , we obtain 2 q = 1 ⟹ q = 2 1 . Plugging this value of q into equation 1 , we obtain p = − 2 1 . Thus for all k , m ( k ) = − 2 1 + 2 1 ∗ 3 k = 2 3 k − 1 = 3 k − 1 + 3 k − 2 + . . . + 1 . According to the question k = 2 9 9 , so we should find the value of 2 3 2 9 9 − 1 modulo 1 0 0 0 , which is 3 3 3 . So our final answer is 3 3 3 .
We prove, by induction on k , that g k ( x ) = x + c k x 2 + x 3 ⋅ h k , where h k is some polynomial in x , so that we need to find c 2 9 9 m o d 1 0 0 0 . Moreover, we also show that c k = 2 3 k − 1 .
Base Case: k = 0 : g k ( x ) = x = x + 0 ⋅ x 2 + x 3 ⋅ ( 0 ) , as needed. Moreover, we also have that 0 = 2 1 − 1 = 2 3 0 − 1 .
Induction Step: Assume that g k ( x ) = x + c k x 2 + x 3 ⋅ h k , and c k = 2 3 k − 1 . Then, by definition,
g k + 1 ( x ) = g k ( x 2 + 2 x ) − g k ( x ) = ( x 2 + 2 x ) + c k ( x 2 + 2 x ) 2 + ( x 2 + 2 x ) 3 ⋅ h k − ( x + c k x 2 + x 3 ⋅ h k ) = x + ( 3 c k + 1 ) x 2 + 4 c k x 3 + c k x 4 + ( x 6 + 6 x 5 + 1 2 x 4 + 7 x 3 ) ⋅ h k = x + ( 3 c k + 1 ) x 2 + x 3 ⋅ ( 4 c k + c k x + ( x 3 + 6 x 2 + 1 2 x + 7 ) ⋅ h k ) ,
and so g k + 1 ( x ) is of the necessary form, and moreover, c k + 1 = 3 c k + 1 = 3 ⋅ 2 3 k − 1 + 1 = 2 3 k + 1 − 3 + 2 2 = 2 3 k + 1 − 1 .
It remains to calculate c 2 9 9 = 2 3 2 9 9 − 1 m o d 1 0 0 0 . Now, 3 2 9 9 = 3 ⋅ 9 1 4 9 = 3 ⋅ ( 1 0 − 1 ) 1 4 9 . By the binomial theorem, this expands to 3 ⋅ ∑ k = 0 1 4 9 ( k 1 4 9 ) 1 0 k ( − 1 ) 1 4 9 − k which is equivalent to 3 ⋅ ( ( 0 1 4 9 ) 1 0 0 ( − 1 ) 1 4 9 + ( 1 1 4 9 ) 1 0 1 ( − 1 ) 1 4 8 + ( 2 1 4 9 ) 1 0 2 ( − 1 ) 1 4 7 ) m o d 1 0 0 0 , since every other term of the sum is divisible by 1000. Furthermore, we see by straightforward calculation that this value is equivalent to 3 ⋅ ( − 1 + 1 4 9 ⋅ 1 0 + 1 1 0 2 6 ⋅ 1 0 0 ⋅ − 1 ) = − 3 3 0 3 3 3 3 ≡ 6 6 7 m o d 1 0 0 0 . Therefore, 2 3 2 9 9 − 1 ≡ 2 6 6 7 − 1 ≡ 3 3 3 m o d 1 0 0 0 , and so c 2 9 9 = 3 3 3 .
Note: This is only one of many ways of calculating 3 2 9 9 m o d 1 0 0 0 . Another method is to recall that λ ( 1 0 0 0 ) = 1 0 0 where λ ( n ) is the n th Carmichael number, and so 3 1 0 0 ≡ 1 m o d 1 0 0 0 . Using the extended Euclidean algorithm, it follows that 3 9 9 ≡ 6 6 7 m o d 1 0 0 and so 3 2 9 9 ≡ 6 6 7 m o d 1 0 0 0 .
Consider a fixed k . Let g k ( x ) = ∑ i = 0 n a n x n . From the formula to compute g k + 1 we can easily see that the coefficient of x 2 in g k + 1 only depends on ( a 0 , a 1 , a 2 ) , because higher powers of x 2 + 2 x do not contain the term x 2 . Hence it is sufficient to keep track of the last three coefficients of each polynomial.
Additionally, we can easily see that in each g k the units coefficient is a 0 = 0 (obvious) and the coefficient of x 1 is a 1 = 1 (easily proved by induction).
This leaves us with a single remaining step: given the coefficient a 2 of x 2 in g k , we should compute the coefficient of x 2 in g k + 1 . From the definition of g k + 1 we easily obtain that the new coefficient is 4 a 2 + a 1 − a 2 = 3 a 2 + a 1 = 3 a 2 + 1 .
Together with the initial condition that in g 0 the coefficient of x 2 is 0 , this produces the sequence 0, 1, 4, 13, 40, 121, 364, ... Note that the initial terms of this sequence can also be obtained by completely evaluating the first few terms of our polynomial sequence. And having these terms, guessing the pattern is trivial.
We can now use the obtained recurrence to compute the required coefficient in g 2 9 9 directly (possibly doing all operations modulo 1000 to avoid large numbers). Alternately, we may note that our coefficient in g i can be written as ( 3 i − 1 ) / 2 .
"We can now use the obtained recurrence to compute the required coefficient in g 2 9 9 directly (possibly doing all operations modulo 1000 to avoid large numbers). Alternately, we may note that our coefficient in g i can be written as ( 3 i − 1 ) / 2 ." A computer was probably used, though the problem is basically solved by hand.
g 0 ( x ) = x , and coefficient of x 2 is 0, g 1 ( x ) = x 2 + x , and coefficient of x 2 is 1, g 2 ( x ) = x 4 + 4 x 3 + 4 x 2 + x , and coefficient of x 2 is 4, then for g 3 , we only need to focus the quadratic terms, which is 4 ( x 2 + 2 x ) 2 − 4 x 2 , (the first term is from g 3 and the second term is from g 2 .) And coefficient of x 2 in g 3 is 40. Now we can let the coefficient of g 0 ( x ) be a 0 and so on. Then a 0 = 0 , a 1 = 1 , a 2 = 4 , a 3 = 1 3 , a 4 = 4 0 . . . . , a n = 3 a n − 1 + 1 , and therefore a n = 3 ( 3 a n − 2 + 1 ) + 1 = 3 2 a n − 2 + 3 + 1 = 3 2 ( 3 a n − 1 ) + 3 + 1 = . . . = 3 n − 1 + 3 n − 2 + 3 n − 3 + . . . + 3 2 + 3 + 1 = ( 3 n − 1 ) / 2 So now we need to figure out the last three digits of ( 3 2 9 9 − 1 ) / 2 . And we know the last 3 digits of power of 3 repeats every 100 terms , i.e. the last 3 digits of 3 0 is 0 0 1 and it is the same as 3 1 0 0 . Therefore the last three digits of 3 2 9 9 must be 6 6 7 in order to let the last three digits of 3 3 0 0 be 0 0 1 again. Then the last three digits ( 3 2 9 9 − 1 ) / 2 is ( 6 6 7 − 1 ) / 2 = 3 3 3 .
Define polynomial f k ( x ) as g k ( x − 1 ) . Then f 0 ( x ) = x − 1 and the recursive equation rewrites as follows: f k + 1 ( x ) = g k + 1 ( x − 1 ) = g k ( ( x − 1 ) 2 + 2 ( x − 1 ) ) − g k ( x − 1 ) = = g k ( x 2 − 1 ) − g k ( x − 1 ) = f k ( x 2 ) − f k ( x )
The first few polynomials f i ( x ) are:
f 1 ( x ) f 2 ( x ) f 3 ( x ) = x 2 − x = x 4 − 2 x 2 + x = x 8 − 3 x 4 + 3 x 2 − x
Notice how the binomial coefficients appear. One can prove by induction that for all k ≥ 1 f k ( x ) = i = 0 ∑ k i ! ( k − i ) ! k ! ( − 1 ) k − i x 2 i Therefore, g k ( x ) = i = 0 ∑ k i ! ( k − i ) ! k ! ( − 1 ) k − i ( x + 1 ) 2 i The coefficient of x 2 in g k ( x ) is i = 0 ∑ k i ! ( k − i ) ! k ! ( − 1 ) k − i 2 2 i ( 2 i − 1 ) . This equals 2 1 ( i = 0 ∑ k i ! ( k − i ) ! k ! ( − 1 ) k − i 2 2 i − i = 0 ∑ k i ! ( k − i ) ! k ! ( − 1 ) k − i 2 i ) = 2 ( − 1 + 4 ) k − ( − 1 + 2 ) k = 2 3 k − 1
To find the last three digits of 2 3 2 9 9 − 1 , we first note that 3 4 = 8 1 ≡ 1 ( m o d 1 6 ) , so 3 2 9 9 ≡ 3 3 ≡ 1 1 ( m o d 1 6 ) . Therefore 2 3 2 9 9 − 1 ≡ 5 ( m o d 8 ) . Also, by Euler's theorem, 3 1 0 0 ≡ 1 ( m o d 1 2 5 ) . So 3 2 9 9 ≡ 3 1 ≡ 4 2 ( m o d 1 2 5 ) . So 2 3 2 9 9 − 1 ≡ 8 3 ( m o d 1 2 5 ) . Putting these together and considering that 1 2 5 ≡ 1 ( m o d 8 ) , the last three digits of 2 3 2 9 9 − 1 are 8 3 + 2 ⋅ 1 2 5 = 3 3 3 .
Problem Loading...
Note Loading...
Set Loading...
Let us take g k to be a general polynomial, and thus write it as,
g k = ∑ i = 0 n ( a i ⋅ x i ) ( Where n is the degree... some number )
So, putting this in the given recursive relation, and also noticing that in,
g k − 1 ( x ⋅ ( x + 2 ) ) ,
we cannot get coefficients of x 2 anywhere except in
( x ⋅ ( x + 2 ) ) 2 a n d ( x ⋅ ( x + 2 ) ) .
Let A k be the coefficient of x 2 and B k be the coefficient of x. We get a recursive relation for the coefficients as,
A k = ( 3 ⋅ A k − 1 ) + B k − 1
B k = B k − 1 (Thus B k = B 0 for all k) Solving this recurrence relation will give us, A k = ( 3 k − 1 ) / 2 . This can be obtained by repeatedly substituting it in the relation(Short way) or by some other prevalent methods.
Now , putting k=299 we just have to find the remainder with 1000, which can be easily done using binomial. Writing 3 2 9 9 as 3 ∗ ( ( 1 0 − 1 ) 1 4 9 ) . We leave the terms with 1000 as a factor alone and get the answer as 333.