HI
please help am gettting WA with this logic
my code:
https://ide.codingblocks.com/s/75790
question link:
https://hack.codingblocks.com/contests/c/668/729
my logic:
for given n find out all prime numbers till n
now i can select only the highest powers of the possible primes in my possession because selecting any prime of power lower than its max possible power will lead to a/b in question to be further reducable (i havent calculated power of each prime bcoz its not of use in this qn according to me)
then
i will have choice to either pick one prime (prime^its highest) or not amongst all primes and multiply the selected primes
LET multiplication of a prime combination = ’ a ’ (a number)
THEN:
and for every such combination i will have 2 numbers n ! / ( a ) and ( a ) and one of these will be smaller than the other and they cannot be reduced further when placed in proper fraction format i.e a/b
and so i get finally total of 2 ^ ( cnt of all distinct primes ) - 1 proper fractions as asked in question