{"id":793,"date":"2020-12-12T13:22:20","date_gmt":"2020-12-12T13:22:20","guid":{"rendered":"https:\/\/integralsandseries.in\/?p=793"},"modified":"2025-11-10T06:10:03","modified_gmt":"2025-11-10T06:10:03","slug":"the-group-of-units-in-the-integers-modulo-n","status":"publish","type":"post","link":"https:\/\/integralsandseries.in\/?p=793","title":{"rendered":"When is the group of units in the integers modulo n cyclic?"},"content":{"rendered":"\n<p>\nIt is easy to see with the help of <a href=\"https:\/\/en.wikipedia.org\/wiki\/B%C3%A9zout%27s_identity\">Bezout&#8217;s identity<\/a> that the integers co-prime to $n$ from the set $\\{0,1,\\cdots, n-1\\}$ form a group under multiplication modulo $n$. This group is denoted by $(\\mathbb{Z}\/n\\mathbb{Z})^*$ and it&#8217;s order is given by the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Euler%27s_totient_function\">Euler&#8217;s Totient function<\/a>: $\\varphi(n) = |(\\mathbb{Z}\/p\\mathbb{Z})^*| $. Gauss showed that $(\\mathbb{Z}\/n\\mathbb{Z})^*$ is a cyclic group if and only if  $n=1,2,4,p,p^k$ or $2p^k$,  where $p$ is an odd prime and $k &gt; 0$. It is very easy to verify this for $n=1,2$ and $4$, as one can simply list out all positive integers less than and co-prime to $n$. So, we will only focus on proving that $(\\mathbb{Z}\/n\\mathbb{Z})^*$ is cyclic for the remaining three cases.\n<\/p>\n\n\n\n\n<p>\n<b>Theorem 1: <\/b> $(\\mathbb{Z}\/p\\mathbb{Z})^*$ is cyclic if $p$ is a prime.\n<\/p>\n\n<p><b>Proof: <\/b> Let $d_1, d_2, \\cdots , d_r$ be all the possible orders of the elements of $(\\mathbb{Z}\/p\\mathbb{Z})^*$. Let $e=\\text{lcm}(d_1, d_2, \\cdots, d_r)$ and factor $e=p_1^{a_1} p_2^{a_2}\\cdots p_k^{a_k}$ as a product of distinct prime powers. By the definition of $\\text{lcm}$, for each $p_i^{a_i}$ there is some $d_j$ divisible by it. Since the $d_j$&#8217;s are orders of elements of $(\\mathbb{Z}\/p\\mathbb{Z})^*$, there is an element $x_i$ whose order is $p_i^{a_i} t$. Then, the element $y_i = x_i^t$ has order $p_i^{a_i}$. Hence, $y_1 y_2\\cdots y_k$ has order $e$. Thus, we have found an element of order $e$. Therefore, $e|p-1$. But the polynomial $x^e-1$ has $p-1$ roots $(\\text{mod }p)$. Since $\\mathbb{Z}\/p\\mathbb{Z}$ is a field, any polynomial of degree $e$ cannot have more than $e$ roots. Therefore, $p-1\\leq e$ and we deduce that $e=p-1$. Thus, we have found an element of order $p-1$. <\/p>\n\n\n\n\n<p><b>Theorem 2: <\/b> $(\\mathbb{Z}\/p^a \\mathbb{Z})^*$ is cyclic for any $a\\geq 1$ if $p$ is an odd prime.<\/p>\n<p>\n<b>Proof:<\/b> For $a=1$, we are done by Theorem 1. Let $g$ be a primitive root $(\\text{mod }p)$. We first find a $t$ such that $(g+pt)^{p-1}\\not\\equiv 1 \\; (\\text{mod }p^2)$. If $g^{p-1}\\not\\equiv 1 \\; (\\text{mod }p^2)$, then we can take $t=0$. Otherwise, we can choose $t=1$. Indeed, we have $(g+p)^{p-1}\\equiv 1+p(p-1)  g^{p-2} \\not \\equiv 1 \\; (\\text{mod }p^2)$. Let $g+pt$ have order $d\\; (\\text{mod }p^a)$. Then, $d|p^{a-1} (p-1)$. Since $g$ is a primitive root modulo $p$, $(p-1) | d$. So, $d=p^{r-1} (p-1)$ for some $r\\leq a$. We also know that $(g+pt)^{p-1} = 1+p s$ where $s \\nmid p$. Thus,\n$$\n\\begin{aligned}\n(g+pt)^{p(p-1)} &amp;= (1+ps)^{p} \\\\\n&amp;= \\sum_{i=0}^{p} \\binom{p}{i} (ps)^i  \\\\\n&amp;\\equiv 1+p^2 s \\; (\\text{mod }p^3)\n\\end{aligned}\n$$\nBy induction, it follows that\n$$ (g+pt)^{p^{b-1}(p-1)} \\equiv 1+p^b s \\; (\\text{mod }p^{b+1}) $$\nNow, $g+pt$ has order $d=p^{r-1}(p-1)\\; (\\text{mod } p^a)$ which implies $(g+pt)^{p^{r-1}(p-1)} \\equiv 1 \\; (\\text{mod }p^a)$. But then $1+p^r s \\equiv 1 \\; (\\text{mod } p^{r+1})$ if $r\\leq a-1$, which implies $p | s$, a contradiction. Thus, $r=a$.\n<\/p>\n\n\n\n<p>\n<b>Theorem 3:<\/b>  $(\\mathbb{Z}\/2p^a \\mathbb{Z})^*$ is cyclic for any $a\\geq 1$ if $p$ is an odd prime.\n<\/p>\n<p>\n<b>Proof:<\/b> This follows immediately from Theorem 2 and the <a href=\"https:\/\/math.stackexchange.com\/questions\/1659507\/chinese-remainder-theorem-induces-a-unit-group-isomorphism\">Chinese remainder theorem<\/a>.\n<\/p>\n\n\n\n\n<p>\nThe fact that $(\\mathbb{Z}\/n\\mathbb{Z})^*$ can be cyclic only for the cases discussed above can also be verified easily using the Chinese remainder theorem.\n<\/p>\n\n\n\n<h2>References<\/h2>\n<ul>\n<li>M. Ram Murty. <i>Problems in analytic number theory<\/i>. Springer New York, 01-Nov-2008<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It is easy to see with the help of Bezout&#8217;s identity that the integers co-prime to $n$ from the set $\\{0,1,\\cdots, n-1\\}$ form a group under multiplication modulo $n$. This group is denoted by $(\\mathbb{Z}\/n\\mathbb{Z})^*$ and it&#8217;s order is given &hellip; <a href=\"https:\/\/integralsandseries.in\/?p=793\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[2],"tags":[8,7],"class_list":["post-793","post","type-post","status-publish","format-standard","hentry","category-number-theory","tag-abstract-algebra","tag-number-theory"],"_links":{"self":[{"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/posts\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=793"}],"version-history":[{"count":43,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions\/1151"}],"wp:attachment":[{"href":"https:\/\/integralsandseries.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/integralsandseries.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}