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.

A140517 Number of cycles in an n X n grid.

Original entry on oeis.org

0, 1, 13, 213, 9349, 1222363, 487150371, 603841648931, 2318527339461265, 27359264067916806101, 988808811046283595068099, 109331355810135629946698361371, 36954917962039884953387868334644457, 38157703688577845304445530851242055267353, 120285789340533859558405124213592877516931371715
Offset: 0

Views

Author

Don Knuth, Jul 26 2008

Keywords

Comments

Or, number of simply connected and rookwise connected regions of an (n-1) X (n-1) grid.

References

  • D. E. Knuth, The Art of Computer Programming, Volume 4A, Section 7.1.4.

Crossrefs

Corner-to-corner paths in this grid are enumerated in A007764.
Main diagonal of A231829.

Programs

  • Mathematica
    Table[Length[FindCycle[GridGraph[{n, n}], Infinity, All]], {n, 6}] (* Eric W. Weisstein, Mar 07 2023 *)
  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A140517(n):
        if n == 0: return 0
        universe = tl.grid(n, n)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    print([A140517(n) for n in range(9)])  # Seiichi Manyama, Mar 23 2020

Extensions

a(9) calculated using the ZDD technique described in Knuth's The Art of Computer Programming, Exercises 7.1.4, by Ashutosh Mehra, Dec 19 2008
a(10)-a(19) calculated using a transfer matrix method by Artem M. Karavaev, Jun 03 2009, Oct 20 2009
a(20)-a(26) calculated by Hiroaki Iwashita, Apr 26 2013, Nov 18 2013
Edited by Max Alekseyev, Jan 24 2018