human
Number Theory | Generators of finite cyclic group under addition | Function to return gcd of a and b.
Print generators of n.
1 is always a generator.
A number x is generator of GCD is 1.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to number Theory and the other steps required.
 def gcd ( a , b ) :
	if ( a == 0 ) :
		return b ;
	return gcd ( b % a , a ) ;
def printGenerators ( n ) :
	print ( "1" , end = " ▁ " ) ;
	for i in range ( 2 , n ) :
		if ( gcd ( i , n ) == 1 ) :
			print ( i , end = " ▁ " ) ;
n = 10 ;
printGenerators ( n ) ;