Find relatively prime number for 7
7 = 1, 2, 3, 4, 5, 6
GCD(x, 7) = 1 (7 with any number whose GCD is 1 are relatively prime numbers)

A number a such that a raised to relatively prime numbers mod 7 should return relatively prime number
= 1, 2, 3, 4, 5, 6

aPrimitive Root
1111111N
2241241N
3326451Y
4421421N
5546321Y
6616161N

Here 3, 5 are the primitive roots of 7
If we get mod value as 1 then the sequence is going to repeat again