Re: [math-fun] Simple finite group problem
I finished my program to find all mutiplicative groups mod N through N=1000, and added the results to OEIS. It's A265165. Apparently nobody is happy with my name, saying that it ought to be reserved for only those groups whose identity element is 1. (That's another sequence which I plan to add as soon as I better understand how to work with OEIS.) I think the name is perfectly descriptive, and that the example makes it clear that I mean *all* such groups. But if people are unhappy, does anyone have any alternative ideas for a short descriptive name? Thanks. Everyone has strengths and weaknesses. One of my weaknesses is graphical user interfaces. I've always found them profoundly unintuitive and difficult to work with. I'm very good at a Unix shell prompt, or in the Emacs editor. In the Lynx browser, I can invoke Emacs in any text-entry box. But apparently I can't log onto OEIS (unlike Wikipedia) with Lynx. And apparently I'm not supposed to discuss a draft OEIS entry except within OEIS, by typing into a text box in a graphical browser, which I find to be about as primitive and difficult to edit as 1960s punched cards. For instance why does it remove all my formatting and paragraph breaks? Also, now that my sequence is no longer in draft, there isn't even a text box for me to reply to the latest "don't reply to this email" emails about the sequence. (Also this weekend I've been trying to get a printer working with my Ubuntu laptop, and have been getting nowhere. I'm so frustrated I'd just as soon write my own printer driver (I've done it before), except that Lexmark doesn't document the necessary internals. I'm sick and tired of getting high-resolution images of frowny face icons in lieu of useful information.) I also have a b file, at http://KeithLynch.net/b265165.txt I've read the OEIS documentation on contributing a b file, but I can't see where it says how to upload it into OEIS. Do I use sftp? That doesn't seem to work. Thanks to N.J.A. Sloane for manually uploading my a file. I'd be glad to upload my b file myself if someone can tell me how it's done. Anyhow, here's a description of the algorithm I use: For every N (modulus), 1 through 1000, I try every I, 1 through N-1, to see if it equals its own square (mod N). If it does, it's an identity element for at least one multiplicative group mod N. For instance for mod 10 the identity elements are 0, 1, 5, and 6. For each I, I try every J, 1 through N-1, to see if repeatedly multiplying J by itself ever gets back to I. If it does, I've found a cyclic group, which consists of the successive powers of J. If it doesn't reach I within N steps, I know it never will, and that there's no group containing both I and J. With each "new" cyclic group, I put the elements in numerical order and add them to the table after making sure it's not a duplicate. After I've found all cyclic groups for that N and that I, I take the union of each pair of them. In general the union of two groups isn't a group, so I complete the new group by including the product of each pair of elements of the union in the group if it wasn't there already. I may have to do that multiple times, as the product of the newly added element with another element may not be in the union. (Apparently, I never have to do it more than twice.) Once the new group is complete, I put its elements in numerical order and add the new group to the the table if it's not a duplicate. I then take the union of each cyclic group with each of these new groups, in the same way. This too I need to do multiple times, until in one such step I find nothing but duplicates. The most times I've had to do it (for N through 1000) is five. I then output the table to what became the a file, http://oeis.org/A265165/a265165.txt (The trivial group with 0 as its element, I don't compute, but just "forcibly" include for every N.) The format of that a file should be obvious: N, I: The elements of the group in numerical order. There are 90754 groups in total. If anyone can find a flaw in that algorithm, speak now or forever hold your peace. It does agree with the groups I computed by brute force (by testing every possible subset to see if it's a group) through N=36. Unfortunately, the brute-force algorithm isn't practical much beyond N=36, which took more than a day. My new algorithm is much faster, taking only ten minutes to get up to N=1000. I could easily push it as far as N=10,000 if anyone is interested. To get the elements of the sequence, I use the following Unix command: grep : a265165.txt | cut -f 1 -d\ | uniq -c > b265165.txt That actually gets me a reverse b sequence. The right two numbers are on each line, but they're in the wrong order. It's easy to fix with Emacs or whatever your preferred editor is. Or if you want the (reverse) b sequence for just the number of groups with 1 as an identity element: grep \ 1: a265165.txt | cut -f 1 -d\ | uniq -c > bwhatever.txt By popular request, I'll also upload my 120-line C program. But not until I've added comments. For good mental exercise, I wrote it entirely without comments.
I think your algorithm is correct, but could be sped up a lot by doing a little more math and less computing. On Sun, May 1, 2016 at 6:21 PM, Keith F. Lynch <kfl@keithlynch.net> wrote:
For every N (modulus), 1 through 1000, I try every I, 1 through N-1, to see if it equals its own square (mod N). If it does, it's an identity element for at least one multiplicative group mod N. For instance for mod 10 the identity elements are 0, 1, 5, and 6.
In general, there will be 2^n of these, where n is the number of distinct primes dividing N. Once you've determined, one way or another, the groups for I = 1, you don't need to do the computation for the other 2^n -1 identities, because you've already counted these! The groups with identity I are in 1-1 correspondence with the groups mod N/I with identity 1, so you can just look up how many of these there are, since you've already counted them. For counting the groups with identity 1, I suspect that a much faster algorithm could be devised, starting by factoring N, which lets you express the meximal group of all elements relatively prime to N as a product of cyclic groups; for each prime p that divides N, if p^k is the largest power of p that divides N, then this gives you a cyclic group of order p^k - p^(k-1). The overall group that you're looking for the subgroups of is the direct product of these groups, one for each prime that divides N. I think there should be some faster way to find the subgroups once you have the group in this form, though I haven't found it yet. Andy
participants (2)
-
Andy Latto -
Keith F. Lynch