This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A270120 #30 Jul 23 2025 15:40:00 %S A270120 0,1,1,2,1,2,1,4,3,2,1,4,1,2,1,6,1,4,1,6,3,2,1,8,5,2,3,4,1,4,1,6,1,2, %T A270120 1,8,1,2,3,12,1,8,1,4,3,2,1,12,7,6,1,6,1,4,5,8,3,2,1,12,1,2,9,10,1,4, %U A270120 1,6,1,4,1,16,1,2,5,4,1,8,1,20,9,2,1,16,1,2,1,8,1,8,1,4,3,2,1,12,1,8,3,14 %N A270120 Number of k with k^n=1 (mod n) and k^k=k (mod n); related to some groups of order n. %C A270120 Given integers n and k, consider the operation %C A270120 o_k: Z_n x Z_n -> Z_n, (a, b) -> a + k^a * b (mod n). %C A270120 (Z_n, o_k) is a group if k^n == 1 (mod n) and k^k == k (mod n). %C A270120 The first condition is necessary to get the definition well-defined. %C A270120 The second condition is necessary for the associative property. %C A270120 a(n) gives the number of different k out of {1, 2, ..., n-1} that comply the conditions. %C A270120 E.g., for n = 4, k = -1 (or, what is the same, k = 3) results in the Klein four-group. (a o_3 b := a + (-1)^a * b (mod 4).) %C A270120 Note that different k can result in groups that are isomorphic to each other. %C A270120 The neutral element is always 0. %C A270120 The inverse element to a is always -a*k^(-a) (mod n). %H A270120 Antti Karttunen, <a href="/A270120/b270120.txt">Table of n, a(n) for n = 1..65537</a> %H A270120 Alfred Heiligenbrunner, <a href="/A270120/a270120_1.txt">A270120 Further examples and how the small groups were named</a> %H A270120 OEIS Wiki, <a href="http://oeis.org/wiki/Number_of_groups_of_order_n">OEIS Wiki Groups of order n</a> %e A270120 a(4) = 2, because in Z_4, k == 1 and k == 3 are the only number out of {0, 1, 2, 3} with conditions k^k==k mod n and k^n==1 mod n. %e A270120 a(8) = 4, because k can be out of {1, 3, 5, 7}. %e A270120 a(18) = 4, because k can be out of {1, 7, 13, 17}. %e A270120 If n is even, k == -1 (or, equivalently, k == n-1) is always to be counted. This group is isomorphic to the Dihedral group D_(n/2), with generating elements -1 and 2. %e A270120 The following table shows the first results with n, k and the name of the group (due to A. D. Thomas and G. V. Wood: 'Group Tables', found by comparing the element-orders). %e A270120 Note that for n=8, k=1 and k=5 result in Z8. None of the k results in Z2 x Z4 or in Z2 x Z2 x Z2. %e A270120 Note that for n=9 all k are isomorphic to Z9, none to Z3 x Z3. %e A270120 n=2, k=1: Z2 %e A270120 n=3, k=1: Z3 %e A270120 n=4, k=1: Z4 %e A270120 n=4, k=3: Z2 x Z2 %e A270120 n=5, k=1: Z5 %e A270120 n=6, k=1: Z6 %e A270120 n=6, k=5: D3 %e A270120 n=7, k=1: Z7 %e A270120 n=8, k=1: Z8 %e A270120 n=8, k=3: Q4 %e A270120 n=8, k=5: Z8 %e A270120 n=8, k=7: D4 %e A270120 n=9, k=1: Z9 %e A270120 n=9, k=4: Z9 %e A270120 n=9, k=7: Z9 %e A270120 n=10, k=1: Z10 %e A270120 n=10, k=9: D5 %e A270120 ... %t A270120 Table[Length[ Select[Range[1, n-1], ((GCD[n, # - 1] > 1) && (PowerMod[#, n, n] == 1) && (PowerMod[#, # - 1, n] == 1)) &]], {n, 1, 100}] %o A270120 (PARI) a(n) = sum(k=1, n-1, (Mod(k,n)^n == 1) && (Mod(k,n)^k == k)); \\ _Michel Marcus_, Mar 12 2016 %Y A270120 Cf. A000001 (number of groups of order n). %K A270120 nonn,easy %O A270120 1,4 %A A270120 _Alfred Heiligenbrunner_, Mar 11 2016