How do we can check for the third condition i.e N!

As it’s range of 500, not idea is commeing how to maintain primes power as the numerator is less than denominator.

It follows a pattern. I can give you a hint.
The task is to factor n! into a and b such that gcd(p,q)=1 and p<q. so we calculate the number of distinct primes in n!
Let prime factorisation of n!= (p1)^x1 * (p2)^x2 (pk)^xk
now for each i, (pi)^xi can either go in p or q. hence 2^k ways. but as we want p<q. therefore only 2^(k-1) ways.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.