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.

Showing 1-5 of 5 results.

A339136 Number of (undirected) cycles in the graph C_3 X P_n.

Original entry on oeis.org

1, 14, 63, 220, 701, 2154, 6523, 19640, 59001, 177094, 531383, 1594260, 4782901, 14348834, 43046643, 129140080, 387420401, 1162261374, 3486784303, 10460353100, 31381059501, 94143178714, 282429536363, 847288609320, 2541865828201, 7625597484854, 22876792454823, 68630377364740
Offset: 1

Views

Author

Seiichi Manyama, Nov 25 2020

Keywords

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339136(n):
        universe = make_CnXPk(3, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A339136(n) for n in range(1, 20)])

Formula

Empirical g.f.: -x*(9*x+1) / ((x-1)^2 * (3*x-1)). - Vaclav Kotesovec, Dec 09 2020

A339137 Number of (undirected) cycles in the graph C_4 X P_n.

Original entry on oeis.org

1, 28, 225, 1540, 10217, 67388, 444017, 2925140, 19270105, 126946444, 836290209, 5509263332, 36293601737, 239092863324, 1575081964113, 10376232739316, 68355938510649, 450311249502892, 2966534083948417, 19542759549039748, 128742647137776169, 848123272992954492
Offset: 1

Views

Author

Seiichi Manyama, Nov 25 2020

Keywords

Crossrefs

Cf. A003699 (Hamiltonian cycles), A288637, A339075, A339136, A339140, A339142, A339143.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339137(n):
        universe = make_CnXPk(4, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A339137(n) for n in range(1, 20)])

Formula

Empirical g.f.: -x*(6*x^3+29*x^2-18*x-1) / ((x-1)^2 * (2*x^3+9*x^2-8*x+1)). - Vaclav Kotesovec, Dec 09 2020

A339140 Number of (undirected) cycles in the graph C_n X P_n.

Original entry on oeis.org

6, 63, 1540, 119235, 29059380, 21898886793, 50826232189144, 361947451544923557, 7884768474166076906420, 524518303312357729182869149, 106448798893410608983300257207398, 65866487708413725073741586390176988083, 124207126413825808953168887580780401519104028
Offset: 2

Views

Author

Seiichi Manyama, Nov 25 2020

Keywords

Examples

			If we represent each vertex with o, used edges with lines and unused edges with dots, and repeat the wraparound edges on left and right, the a(2) = 6 solutions for n = 2 are:
    .o-o.   -o.o-   .o-o.   -o.o-   -o-o-   .o.o.
     | |     | |     | |     | |     . .     . .
    .o-o.   .o-o.   -o.o-   -o.o-   .o.o.   -o-o-
		

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339140(n):
        universe = make_CnXPk(n, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A339140(n) for n in range(3, 7)])

Extensions

a(10) and a(12) from Seiichi Manyama, Nov 25 2020
a(2), a(9), a(11) and a(13)-a(18) from Ed Wynn, Jun 25 2023

A339142 Number of (undirected) cycles in the graph C_5 X P_n.

Original entry on oeis.org

1, 52, 733, 9394, 119235, 1512196, 19177677, 243212478, 3084441599, 39117172360, 496087629441, 6291429718962, 79788500460003, 1011885230273244, 12832823194696645, 162747064808635206, 2063973507784856167, 26175505197898511728, 331960206747350288969, 4209950410912939269210
Offset: 1

Views

Author

Seiichi Manyama, Nov 25 2020

Keywords

Crossrefs

Cf. A003731 (Hamiltonian cycles), A339117, A339136, A339137, A339140, A339143.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339142(n):
        universe = make_CnXPk(5, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A339142(n) for n in range(1, 9)])

Extensions

More terms from Ed Wynn, Jun 28 2023

A338297 Number of Hamiltonian paths in C_6 X P_n.

Original entry on oeis.org

6, 228, 4800, 76116, 1094316, 14557092, 183735204, 2230289220, 26275912776, 302338568832, 3412921463352, 37923555328200, 415863933818988, 4509400849281240, 48428461587426108, 515767225814395500, 5452991323044249720, 57282647077608267072, 598324561437126968664, 6217929367753246782612
Offset: 1

Views

Author

Seiichi Manyama, Dec 18 2020

Keywords

Crossrefs

Cf. A003689 (C_3 X P_n), A003752 (C_4 X P_n), A003732 (C_5 X P_n), A268894 (C_n X P_n).

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXPk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A(start, goal, n, k):
        universe = make_CnXPk(n, k)
        GraphSet.set_universe(universe)
        paths = GraphSet.paths(start, goal, is_hamilton=True)
        return paths.len()
    def B(n, k):
        m = k * n
        s = 0
        for i in range(1, m):
            for j in range(i + 1, m + 1):
                s += A(i, j, n, k)
        return s
    def A338297(n):
        return B(6, n)
    print([A338297(n) for n in range(1, 11)])
Showing 1-5 of 5 results.