Hint 2 of Problem 498 Remainder of polynomial division
Problem 498
For positive integers n and m, we define two polynomials Fn(x) = xn and Gm(x) = (x-1)m.
We also define a polynomial Rn,m(x) as the remainder of the division of Fn(x) by Gm(x).
For example, R6,3(x) = 15x2 - 24x + 10.
Let C(n, m, d) be the absolute value of the coefficient of the d-th degree term of Rn,m(x).
We can verify that C(6, 3, 1) = 24 and C(100, 10, 4) = 227197811615775.
Find C(1013, 1012, 104) mod 999999937.
https://projecteuler.net/problem=498We also define a polynomial Rn,m(x) as the remainder of the division of Fn(x) by Gm(x).
For example, R6,3(x) = 15x2 - 24x + 10.
Let C(n, m, d) be the absolute value of the coefficient of the d-th degree term of Rn,m(x).
We can verify that C(6, 3, 1) = 24 and C(100, 10, 4) = 227197811615775.
Find C(1013, 1012, 104) mod 999999937.
Pick up where we left off earlier.
C(n,m,d) = C(n,d)* sum( C(n-d,k)*(-1)^k ) 0=<k<=m-d-1
Anyone recall that C(N,K) = C(N-1,K)+C(N-1,K-1);
The equation above just makes our life a lot easier.
sum(C(N,k) * (-1)^k) 0=<k<=K
=C(N-1,K)*(-1)^K + C(N-1,K-1)*(-1)^K
+C(N-1,K-1)*(-1)^(K-1) + C(N-1,K-2)*(-1)^(K-1)
+...
+C(N-1,1)*(-1) + C(N-1,0)*(-1)
+C(N,0)*1
=C(N-1,K)*(-1)^K
That is to say,
C(n,m,d) = C(n,d)* sum( C(n-d,k)*(-1)^k ) 0=<k<=m-d-1
=> C(n,m,d) = C(n,d)* C(n-d-1,m-d-1)*(-1)^(m-d-1)
In this case,
C(10^13,10^12,10^4)
= C(10^13 , 10^4) * C(10^13-10^4-1 , 10^12-10^4-1) * (-1)
Since it is an absolute value of d-th degree, we can get rid of the (-1).
C(10^13,10^12,10^4) = C(10^13 , 10^4) * C(10^13-10^4-1 , 10^12-10^4-1)
No Sum, a lot better, right?
But still, things can get even better!
TBC in Hint3!
---------------------
The opinion above is original and unproven work. Please correct me if I made a mistake.
Please tell me if you have reached the correct answer using the methods above.
I am just too lazy to calculate that. :)
Comments
Post a Comment