///求小于n的数里,与n互为素数的个数,这边用到欧拉公式。 #include<iostream> #include<stdio.h> using namespace std; int main() { long n,i; double sum; while(scanf("%ld",&n)&&n) { sum=n; if(n%2==0)// { sum*=(double)1/2; while(n%2==0) n/=2; } for(i=3;n>1;i+=2) { if(n%i==0) sum*=(1-(double)1/i); while(n%i==0) n/=i; } printf("%.0lf/n",sum); } return 0; }