Hint 1 of Problem 498 Remainder of polynomial division

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(nmd) 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=498

Firstful, let's have t=x-1, therefore, x=t+1;
Fn(x) = xn and Gm(x) = (x-1)
Fn(x) = (t+1)and Gm(x) = tm



Therefore, 
Rn,m(x) = sum( C(n,i)*t^i )    0=<i<=m-1

Change t back to x, 
R = sum( C(n,i) * (x-1)^i)

Pick only d-th degree term,
C(n,m,d) = sum( C(n,i)*C(i,d)*(-1)^(i-d) )    d=<i<=m-1

As d = 10^4 is even, we simplify the equation as below,
C(n,m,d) = sum( C(n,i)*C(i,d)*(-1)^i )    d=<i<=m-1

C(n,i) = n!/{(n-i)!*i!} and C(i,d) = i!/{d!*(i-d)!}
C(n,i)*C(i,d) = n!*i!/{(n-i)!*i!*d!*(i-d)!} = n!/{d!(i-d)!(n-i)!}
C(n,i)*C(i,d) = n!/{d!*(n-d)!} * (n-d)!/{(i-d)!(n-i)!}

Magically, 
C(n,i)*C(i,d) = C(n,d)*C(n-d,i-d)

Since C(n,d) is irrelevant to i, we can get that out of the sum and get below simplified version.
C(n,m,d) = C(n,d)* sum( C(n-d,i-d)*(-1)^i )    d=<i<=m-1

Replace i-d with k,
C(n,m,d) = C(n,d)* sum( C(n-d,k)*(-1)^k )    0=<k<=m-d-1


There goes the first and most obvious thought on problem 498
TBC

---------------------

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

Popular posts from this blog

Project Euler Problem 684 Inverse Digit Sum - Solution

Project Euler Problem 686 Powers of Two - Solution

Project Euler Problem 717 Summation of a Modular Formula - Solution