import pandas as pd
import time
def Euler(n: int)-> list:
if(n!=1):
mul = n
res = []
factor = 2
while(n!=1):
if(n%factor==0):
n = n / factor
res.append(factor)
else:
factor += 1
func = lambda x: 1-1/x
res = list(map(func, list(set(res))))
for i in res:
mul *= i
return round(mul)
else:
return 1
def Primitive_root(n: int)-> list:
m = Euler(n)
m_lt = []
for i in range(1, m+1):
m_lt.append(i)
res = []
for a in range(1, 19):
func = lambda x: a**x%n
temp = list(map(func, m_lt))
if(len(set(temp))==m):
res.append(a)
return res
if __name__=='__main__':
n = 19
print(Primitive_root(n))