n = 37 print n a = 0 i = 2 while i <= n: c = pow(i, (n - 1)/2, n) if c == 1 : a +=1 print (i, c) i += 1 print ("col_1", a) # your code goes here
Standard input is empty
37 (2, 36) (3, 1) (4, 1) (5, 36) (6, 36) (7, 1) (8, 36) (9, 1) (10, 1) (11, 1) (12, 1) (13, 36) (14, 36) (15, 36) (16, 1) (17, 36) (18, 36) (19, 36) (20, 36) (21, 1) (22, 36) (23, 36) (24, 36) (25, 1) (26, 1) (27, 1) (28, 1) (29, 36) (30, 1) (31, 36) (32, 36) (33, 1) (34, 1) (35, 36) (36, 1) (37, 0) ('col_1', 17)