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 A007687 M2833 #32 Sep 26 2024 23:37:25 %S A007687 3,10,21,44,83,218,271,692,865,2622,2813,9220,9735,35214,35911,135564, %T A007687 136899,533290,535081 %N A007687 Number of 4-colorings of cyclic group of order n. %C A007687 The number of 2-colorings of Z_n is A000034(n-1), the number of 3-colorings of Z_n is A005843(n). The number of n-colorings of Z_2 is A137928(n-1). - _Andrey Zabolotskiy_, Oct 02 2017 %D A007687 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007687 Robert Haas, <a href="https://doi.org/10.2307/2690938">Three-colorings of finite groups or an algebra of nonequalities</a>, Math. Mag., 63 (1990), 211-225. %H A007687 Robert Haas, <a href="/A007687/a007687.pdf">Letter to N. J. A. Sloane, Aug. 1994</a> %o A007687 (Python) %o A007687 from itertools import product %o A007687 def colorings(n, zp): %o A007687 result = 0 %o A007687 for f in product(range(n), repeat=zp): %o A007687 for j1 in range(zp): %o A007687 for j2 in range(zp): %o A007687 if (f[j1]+f[j2])%n == f[(j1+j2)%zp]: %o A007687 break %o A007687 else: %o A007687 continue %o A007687 break %o A007687 else: %o A007687 result += 1 %o A007687 return result %o A007687 print([colorings(4, k) for k in range(1, 12)]) %o A007687 # _Andrey Zabolotskiy_, Jul 12 2017 %Y A007687 Cf. A007688. %K A007687 nonn,more,hard %O A007687 1,1 %A A007687 _N. J. A. Sloane_ %E A007687 a(6)-a(11) from _Andrey Zabolotskiy_, Jul 12 2017 %E A007687 a(12)-a(17) from _Andrey Zabolotskiy_, Oct 02 2017 %E A007687 a(18)-a(19) from _Lucas A. Brown_, Sep 20 2024