Fasho's blog

By Fasho, history, 2 years ago,

Given a number x and a number y how can I count the number of relatively prime numbers with x that are less then y?

More Formally;

Is there any way to count how many z exists that:(1<=z<=y and gcd(x,z)==1) (x<=4005,y<=10^9).

•  » » » 2 years ago, # ^ |   +1 This is a generalization of Euler's totient function. If you can solve this in $O(1)$ RSA encryption would be broken.
 » 2 years ago, # |   +7 Since $\gcd(x,z)=\gcd(x+z,z)$, we can just calculate \$c[x][y]=\sum\limits_{i=1}^{y}[\gcd(i,x)=1](0\le y