Help me with this.
help me... :)
@ganeshie8
you want to find number of integers less than 1000 that are coprime to 36
yes !!
Notice that 36 = 2^2*3^2 that means every integer thats multiple of 2 or 3 will not be coprime with 36, yes ?
Yes it is ...
simply find out them and subtract from 1000 :)
1 <= 2k <= 1000 1 <= 3k <= 1000
also you need to subtract 6k to account for the double count
I am good with the net issue now. The fact is that I have another question where the limit of n is between 2 and 1000 but the solution is 332. So, I am finding it a bit confusing, cause there are 500 multiples of 2 between 1 and 1000 and 333 of 3 between 1 and 1000 and 166 of 6 between 1 and 1000. But solution is changed.
I mean the gcd of 1 and 36 is 1 right ? @ganeshie8
yeah solution changes because there is 1less number now thats coprime with 36 1 is coprime with 36
Join our real-time social learning platform and learn together with your friends!