Question: How do I create the groups (Z/nZ)+ and (Z/nZ)*?

I want to create the groups (Z/nZ)+ and (Z/nZ)*.

I can do this in python for n=7. I want to do this with other values of n.

(Z/7Z)+
   0 1 2 3 4 5 6
0 0 1 2 3 4 5 6
1 1 2 3 4 5 6 0
2 2 3 4 5 6 0 1
3 3 4 5 6 0 1 2
4 4 5 6 0 1 2 3
5 5 6 0 1 2 3 4
6 6 0 1 2 3 4 5
 
(Z/7Z)*
   1 2 3 4 5 6
1 1 2 3 4 5 6
2 2 4 6 1 3 5
3 3 6 2 5 1 4
4 4 1 5 2 6 3
5 5 3 1 6 4 2
6 6 5 4 3 2 1
 

I tried creating a Cayley table but can not get that right.

Please Wait...