from math import * def explore(): n=input("podaj n ") n=int(n) resztyn = [] for x in range(0,n): resztyn.append(x) print "Elementy odwracalne: " for a in range(0,len(resztyn)): for b in range(0,len(resztyn)): c=((a*b)%n) if c==1 : print a else: continue print "Dzielniki zera: " for a in range(0,len(resztyn)): for b in range(1,len(resztyn)): c=((a*b)%n) if c==0 : print a break else: continue print "Elementy idenpotentne:" for a in range(0,len(resztyn)): c=((a*a)%n) if c==a: print a else: continue print "Elementy nilpotentne:" print "0" for a in range(1,len(resztyn)): for p in range(1,1000): c=((a**p)%n) if c==1: break if c==0: print a break else: continue print '\n' while 1: explore()