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.

A121785 "Spanning walks" on the square lattice (see Jensen web site for further information).

Original entry on oeis.org

8, 95, 2320, 154259, 30549774, 17777600753, 30283708455564, 152480475641255213, 2287842813828061810244, 102744826737618542833764649, 13848270995235582268846758977770
Offset: 1

Views

Author

N. J. A. Sloane, Aug 30 2006

Keywords

Comments

Number of Hamiltonian paths in the graph P_{n+1} X P_{n+1} starting at any of the n+1 vertices on one side of the graph and terminating at any of the n+1 vertices on the opposite side. - Andrew Howroyd, Apr 10 2016

Crossrefs

A333466 Number of self-avoiding closed paths on an n X n grid which pass through four corners ((0,0), (0,n-1), (n-1,n-1), (n-1,0)).

Original entry on oeis.org

1, 1, 11, 373, 44930, 17720400, 22013629316, 84579095455492
Offset: 2

Views

Author

Seiichi Manyama, Mar 22 2020

Keywords

Comments

a(11) = 36061721109572407840288. - Seiichi Manyama, Apr 07 2020

Examples

			a(2) = 1;
   +--+
   |  |
   +--+
a(3) = 1;
   +--*--+
   |     |
   *     *
   |     |
   +--*--+
a(4) = 11;
   +--*--*--+   +--*--*--+   +--*--*--+
   |        |   |        |   |        |
   *--*--*  *   *--*  *--*   *--*     *
         |  |      |  |         |     |
   *--*--*  *   *--*  *--*   *--*     *
   |        |   |        |   |        |
   +--*--*--+   +--*--*--+   +--*--*--+
   +--*--*--+   +--*--*--+   +--*--*--+
   |        |   |        |   |        |
   *  *--*--*   *  *--*  *   *     *--*
   |  |         |  |  |  |   |     |
   *  *--*--*   *  *  *  *   *     *--*
   |        |   |  |  |  |   |        |
   +--*--*--+   +--*  *--+   +--*--*--+
   +--*--*--+   +--*--*--+   +--*  *--+
   |        |   |        |   |  |  |  |
   *        *   *        *   *  *--*  *
   |        |   |        |   |        |
   *  *--*  *   *        *   *  *--*  *
   |  |  |  |   |        |   |  |  |  |
   +--*  *--+   +--*--*--+   +--*  *--+
   +--*  *--+   +--*  *--+
   |  |  |  |   |  |  |  |
   *  *--*  *   *  *  *  *
   |        |   |  |  |  |
   *        *   *  *--*  *
   |        |   |        |
   +--*--*--+   +--*--*--+
		

Crossrefs

Main diagonal of A333513.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A333466(n):
        universe = tl.grid(n - 1, n - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        for i in [1, n, n * (n - 1) + 1, n * n]:
            cycles = cycles.including(i)
        return cycles.len()
    print([A333466(n) for n in range(2, 10)])
    
  • Ruby
    def search(x, y, n, used)
      return 0 if x < 0 || n <= x || y < 0 || n <= y || used[x + y * n]
      return 1 if x == 0 && y == 1 && [n - 1, n * (n - 1), n * n - 1].all?{|i| used[i] == true}
      cnt = 0
      used[x + y * n] = true
      @move.each{|mo|
        cnt += search(x + mo[0], y + mo[1], n, used)
      }
      used[x + y * n] = false
      cnt
    end
    def A(n)
      return 1 if n < 3
      @move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
      used = Array.new(n * n, false)
      search(0, 0, n, used)
    end
    def A333466(n)
      (2..n).map{|i| A(i)}
    end
    p A333466(6)

A333246 Number of self-avoiding closed paths on an n X n grid which pass through NW corner.

Original entry on oeis.org

1, 7, 97, 4111, 532269, 212372937, 263708907211, 1013068026356375, 11955420069208095719, 432101605951906251627393, 47778407166747833830058004149, 16149888968763663448192636077980753, 16675786862526496319891707194153887550751, 52568166380872328447478940416604864445574575709
Offset: 2

Views

Author

Seiichi Manyama, Mar 23 2020

Keywords

Examples

			a(2) = 1;
   +--*
   |  |
   *--*
a(3) = 7;
   +--*      +--*--*   +--*--*   +--*
   |  |      |     |   |     |   |  |
   *--*      *--*--*   *     *   *  *
                       |     |   |  |
                       *--*--*   *--*
   +--*--*   +--*--*   +--*
   |     |   |     |   |  |
   *  *--*   *--*  *   *  *--*
   |  |         |  |   |     |
   *--*         *--*   *--*--*
		

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A333246(n):
        universe = tl.grid(n - 1, n - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles().including(1)
        return cycles.len()
    print([A333246(n) for n in range(2, 10)])

Formula

a(n) = A333439(n) - 1 for n > 1.

Extensions

a(11), a(13) from Seiichi Manyama, Apr 07 2020
a(10), a(12), a(14)-a(15) from Andrew Howroyd, Jan 30 2022

A333247 Number of self-avoiding closed paths on an n X n grid which pass through NW and SW corners.

Original entry on oeis.org

1, 4, 47, 1843, 232905, 92729439, 115234959344, 442748883422394
Offset: 2

Views

Author

Seiichi Manyama, Mar 23 2020

Keywords

Comments

a(11) = 188829168009674568016545. - Seiichi Manyama, Apr 07 2020

Examples

			a(2) = 1;
   +--*
   |  |
   +--*
a(3) = 4;
   +--*--*   +--*--*   +--*      +--*
   |     |   |     |   |  |      |  |
   *     *   *  *--*   *  *--*   *  *
   |     |   |  |      |     |   |  |
   +--*--*   +--*      +--*--*   +--*
		

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A333247(n):
        universe = tl.grid(n - 1, n - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles().including(1).including(n)
        return cycles.len()
    print([A333247(n) for n in range(2, 10)])

A333667 Triangle T(n,k), n >= 2, 0 <= k <= floor(n^2/2)-2*n+2, read by rows, where T(n,k) is the number of 2*(k+2*n-2)-cycles in the n X n grid graph which pass through NW and SE corners ((0,0),(n-1,n-1)).

Original entry on oeis.org

1, 3, 20, 16, 6, 175, 420, 562, 456, 186, 1764, 8064, 21224, 39500, 55376, 57248, 37586, 10260, 1072, 19404, 138600, 569768, 1717152, 4151965, 8371428, 14126846, 19364732, 20241450, 14759356, 6998166, 1927724, 230440
Offset: 2

Views

Author

Seiichi Manyama, Apr 01 2020

Keywords

Examples

			T(3,0) = 3;
   +--*--*   +--*--*   +--*
   |     |   |     |   |  |
   *--*  *   *     *   *  *--*
      |  |   |     |   |     |
      *--+   *--*--+   *--*--+
Triangle starts:
=======================================================================
n\k|      0        1         2 ...      4 ...   8 ...    12 ...     18
---|-------------------------------------------------------------------
2  |      1;
3  |      3;
4  |     20,      16,        6;
5  |    175,     420,      562, ... , 186;
6  |   1764,    8064,    21224, .......... , 1072;
7  |  19404,  138600,   569768, .................. , 230440;
8  | 226512, 2265120, 12922446, ............................ , 4638576;
		

Crossrefs

Row sums give A333323.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A333667(n):
        universe = tl.grid(n - 1, n - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles().including(1).including(n * n)
        return [cycles.len(2 * k).len() for k in range(2 * n - 2, n * n // 2 + 1)]
    print([i for n in range(2, 8) for i in A333667(n)])

Formula

T(n,0) = A000891(n-2).
Showing 1-5 of 5 results.