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.
Can someone give a hint to this? Sieving is too slow even for (10^9)/2 for it to be the right way. The case where k=1 is fine, but how can I solve larger k without knowing the large primes factor of nCm. Getting the product of all primes < N also slow. Is iterating fron k=1 up right? Or is it from from (n-m+1)C1 -> (n-m+2)C2 ->... nCm. Because of k, the problem is quiet different from project euler
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #231: The prime factorisation of binomial coefficients
You are viewing a single comment's thread. Return to all comments →
Can someone give a hint to this? Sieving is too slow even for (10^9)/2 for it to be the right way. The case where k=1 is fine, but how can I solve larger k without knowing the large primes factor of nCm. Getting the product of all primes < N also slow. Is iterating fron k=1 up right? Or is it from from (n-m+1)C1 -> (n-m+2)C2 ->... nCm. Because of k, the problem is quiet different from project euler