{"id":9946,"date":"2020-05-02T20:26:05","date_gmt":"2020-05-03T00:26:05","guid":{"rendered":"https:\/\/spinor.info\/weblog\/?p=9946"},"modified":"2023-12-09T12:51:33","modified_gmt":"2023-12-09T17:51:33","slug":"number-theory-petals-and-necklaces","status":"publish","type":"post","link":"https:\/\/spinor.info\/weblog\/?p=9946","title":{"rendered":"Number theory, petals and necklaces"},"content":{"rendered":"<p>My lovely wife, Ildiko, woke up from a dream and asked: If you have a flower with 7 petals and two colors, how many ways can you color the petals of that flower?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9950\" src=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals.png\" alt=\"\" width=\"260\" height=\"255\" srcset=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals.png 260w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals-24x24.png 24w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals-36x36.png 36w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals-48x48.png 48w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/petals-64x64.png 64w\" sizes=\"(max-width: 260px) 100vw, 260px\" \/><\/p>\n<p>Intriguing, isn&#8217;t it.<\/p>\n<p>Such a flower shape obviously has rotational symmetry. Just because the flower is rotated by several times a seventh of a revolution, the resulting pattern should not be counted as distinct. So it is not simply calculating what number theorists call the \\(n\\)-tuple. It is something more subtle.<\/p>\n<p>We can, of course, start counting the possibilities the brute force way. It&#8217;s not that difficult for a smaller number of petals, but it does get a little confusing at 6. At 7 petals, it is still something that can be done, but the use of paper-and-pencil is strongly recommended.<\/p>\n<p>So what about the more general case? What if I have \\(n\\) petals and \\(k\\) colors?<\/p>\n<p>Neither of us could easily deduce an answer, so I went to search the available online literature. For a while, other than finding some <a href=\"https:\/\/math.stackexchange.com\/questions\/3270801\/cyclic-and-circular-permutation-are-they-different-concepts\">interesting posts<\/a> about cyclic, or circular permutations, I was mostly unsuccessful. In fact, I began to wonder if this one was perhaps one of those embarrassing little problems in combinatorial mathematics that has no known solution and about which the literature remains strangely quiet.<\/p>\n<p>But then I had another idea: By this time, we both calculated the sequence, 2, 3, 4, 6, 8, 14, 20, which is the number of ways flowers with 1, 2, &#8230;, 7 petals can be colored using only two colors. Surely, this sequence is known to Google?<\/p>\n<p>Indeed it is. It turns out to be a well-known sequence in the online encyclopedia of integer sequences, <a href=\"https:\/\/oeis.org\/A000031\">A000031<\/a>. Now I was getting somewhere! What was especially helpful is that the encyclopedia mentioned necklaces. So that&#8217;s what this problem set is called! Finding the <a href=\"https:\/\/mathworld.wolfram.com\/Necklace.html\">Mathworld page on necklaces<\/a> was now easy, along with the corresponding <a href=\"https:\/\/en.wikipedia.org\/wiki\/Necklace_polynomial\">Wikipedia page<\/a>. I also found an attempt, valiant though only half-successful if anyone is interested in my opinion, to <a href=\"https:\/\/math.stackexchange.com\/questions\/2546624\/intuition-behind-necklace-formula\">explain the intuition<\/a> behind this known result:<\/p>\n<p>$$N_k(n)=\\frac{1}{n}\\sum_{d|n}\\phi(d)k^{n\/d},$$<\/p>\n<p>where the summation is over all the divisors of \\(n\\), and \\(\\phi(d)\\) is <a href=\"https:\/\/en.wikipedia.org\/wiki\/Euler%27s_totient_function\">Euler&#8217;s totient function<\/a>, the number of integers between \\(1\\) and \\(d\\) that are relative prime to \\(d\\).<\/p>\n<p>Evil stuff if you asked me. Much as I always liked mathematics, number theory was not my favorite.<\/p>\n<p>In the case of odd primes, such as the number 7 that occurred in Ildiko&#8217;s dream, and only two colors, there is, however, a simplified form:<\/p>\n<p>$$N_2(n)=\\frac{2^{n-1}-1}{n}+2^{(n-1)\/2}+1.$$<\/p>\n<p>Unfortunately, this form is for &#8220;free necklaces&#8221;, which treats mirror images as equivalent. For \\(n&lt;6\\) it makes no difference, but substituting \\(n=7\\), we get 18, not 20.<\/p>\n<p>Finally, a closely related sequence, <a href=\"https:\/\/oeis.org\/A000029\">A000029<\/a>, characterizes necklaces that can be turned over, that is to say, the case where we do not count mirror images separately.<\/p>\n<p>Oh, this was fun. It&#8217;s not like I didn&#8217;t have anything useful to do with my time, but it was nonetheless a delightful distraction. And a good thing to chat about while we were eating a wonderful lunch that Ildiko prepared today.<\/p>\n<fb:like href='https:\/\/spinor.info\/weblog\/?p=9946' send='true' layout='standard' show_faces='true' width='450' height='65' action='like' colorscheme='light' font='lucida grande'><\/fb:like>","protected":false},"excerpt":{"rendered":"<p>My lovely wife, Ildiko, woke up from a dream and asked: If you have a flower with 7 petals and two colors, how many ways can you color the petals of that flower? Intriguing, isn&#8217;t it. Such a flower shape obviously has rotational symmetry. Just because the flower is rotated by several times a seventh <a href='https:\/\/spinor.info\/weblog\/?p=9946' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,35],"tags":[],"class_list":["post-9946","post","type-post","status-publish","format-standard","hentry","category-mathematics","category-personal","category-30-id","category-35-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9946"}],"version-history":[{"count":10,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9946\/revisions"}],"predecessor-version":[{"id":12362,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9946\/revisions\/12362"}],"wp:attachment":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}