cp's OEIS Frontend

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.

A007687 Number of 4-colorings of cyclic group of order n.

Original entry on oeis.org

3, 10, 21, 44, 83, 218, 271, 692, 865, 2622, 2813, 9220, 9735, 35214, 35911, 135564, 136899, 533290, 535081
Offset: 1

Views

Author

Keywords

Comments

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

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007688.

Programs

  • Python
    from itertools import product
    def colorings(n, zp):
        result = 0
        for f in product(range(n), repeat=zp):
            for j1 in range(zp):
                for j2 in range(zp):
                    if (f[j1]+f[j2])%n == f[(j1+j2)%zp]:
                        break
                else:
                    continue
                break
            else:
                result += 1
        return result
    print([colorings(4, k) for k in range(1, 12)])
    # Andrey Zabolotskiy, Jul 12 2017

Extensions

a(6)-a(11) from Andrey Zabolotskiy, Jul 12 2017
a(12)-a(17) from Andrey Zabolotskiy, Oct 02 2017
a(18)-a(19) from Lucas A. Brown, Sep 20 2024