human
Count numbers having GCD with N equal to the number itself | Function to count numbers whose GCD with N is the number itself.
Stores the count of factors of N.
Iterate over the range [ 1 , sqrt ( N ) ].
If i is divisible by i.
Increment count.
Avoid counting the same factor twice.
Return the resultant count.
Driver Code"
How can the above be solved in Python?
 ... What is a code to count numbers having GCD with N equal to the number itself and the other steps required?
assistant
#Here is code to count numbers having GCD with N equal to the number itself and the other steps required.
 def countNumbers ( N ) :
	count = 0
	for i in range ( 1 , N + 1 ) :
		if i * i > N :
			break
		if ( N % i == 0 ) :
			count += 1
			if ( N // i != i ) :
				count += 1
	return count
if __name__ == ' _ _ main _ _ ' :
	N = 10
	print ( countNumbers ( N ) )