We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #160: Factorial trailing digits
Project Euler #160: Factorial trailing digits
Sort by
recency
|
14 Discussions
|
Please Login in order to post a comment
This was a quite hard problem. In order to solve it, fb(n) must be at most log(n). We need to split base number into prime factors and precompute modulo values for every prime up to (prime^k)^5. Then for every prime factor we must calcultate fb_prime(n) mod (prime^k)^5. At the begining we must strip trailing zeroes by multiplying by proper inverses of other primes. This is a little bit tricky and requires carefull analysis. Computing the product factors thar are comprime to given prime can be computed in log(n) time using previously precomputed values mod prime^5k. Finally we must solve a system of linear congruences using Chinese Reminder Theorem.
Hi, can someone help me with the code? I am able to pass all test cases that I enter manually. Tried with 22b16, 22b10, 20b10, 20b16, 10b10, 10b9, 22b2 etc. However, the code is only passing testcase 0;
Hi, can someone help me with my code. I could pass only 1 test case. For other test cases it say terminated due to timeout.
Hi, I am trying to solve the problem using Python. I am getting pass the first test case, but my code is failing rest all of the test cases. Admin can you please provide us with some complex test cases with different base value to show what is the input and what is expected output.
i cant get the base one