number of coprimes to a less than b

718 Views Asked by At

We know that number of coprimes less than a number can be found using euler function https://brilliant.org/wiki/eulers-totient-function/ But if there are two numbers p,q and we need to find number of numbers less than q and coprime to p. Is there any efficient method ? can we develop an algorithm.