Primes with a Twist
Given an integer n(1<=n<=10^4), you need to count the numbers, x,< n, which are co-prime to 'n', i.e. gcd(x,n)=1.
Formally, given n, you need to find f(n)=[{x<n:gcd(x,n)=1}].
Return the count of the number of co-primes of 'n'.
Input Specification:
input1:the integer 'n'
output Specification :
Return the count of the number of co-prime of 'n'
Example 1:
input1: 4
Output2: 2
Explanation:
Integers 1 and 3 are co-prime to 4, but 2 is not.
Example 2:
input1: 16
Output2: 8
Explanation:
Integers 1,3,5,7,9,11,13 and 15are co-prime to 16.
Answer are :
x = int(input(""));
count1=int(1);
res =1;
count2=count1;
while count1!=x:
res = count1 % 2;
if res!=0:
count2=count2+1;
count1=count1+1
print(count2-1)