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-6 of 6 results.

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)

A333758 Square array T(n,k), n >= 2, k >= 2, read by antidiagonals, where T(n,k) is the number of self-avoiding closed paths in the n X k grid graph which pass through all vertices on four (left, right, upper, lower) sides of the graph.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 5, 11, 5, 1, 1, 11, 36, 36, 11, 1, 1, 21, 122, 191, 122, 21, 1, 1, 43, 408, 1123, 1123, 408, 43, 1, 1, 85, 1371, 6410, 11346, 6410, 1371, 85, 1, 1, 171, 4599, 37165, 113748, 113748, 37165, 4599, 171, 1
Offset: 2

Views

Author

Seiichi Manyama, Apr 04 2020

Keywords

Examples

			T(4,3) = 3;
   +--+--+   +--+--+   +--+--+
   |     |   |     |   |     |
   +--*  +   +  *--+   +     +
      |  |   |  |      |     |
   +--*  +   +  *--+   +     +
   |     |   |     |   |     |
   +--+--+   +--+--+   +--+--+
Square array T(n,k) begins:
  1,  1,   1,    1,      1,       1,        1, ...
  1,  1,   3,    5,     11,      21,       43, ...
  1,  3,  11,   36,    122,     408,     1371, ...
  1,  5,  36,  191,   1123,    6410,    37165, ...
  1, 11, 122, 1123,  11346,  113748,  1153742, ...
  1, 21, 408, 6410, 113748, 2002405, 35669433, ...
		

Crossrefs

Rows n=2..7 give: A000012, A001045(n-1), A333760, A358696, A358697, A358698.
Main diagonal gives A333759.
Cf. A333513.

Programs

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

Formula

T(n,k) = T(k,n).

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

Original entry on oeis.org

1, 7, 49, 373, 3105, 26515, 227441, 1953099, 16782957, 144262743, 1240194297, 10662034451, 91663230249, 788046822891, 6775004473757, 58246174168047, 500755017859261, 4305100014182879, 37011883913816129, 318199242452585915, 2735628331213604009, 23518793814422304163
Offset: 2

Views

Author

Seiichi Manyama, Mar 25 2020

Keywords

Comments

Also number of self-avoiding closed paths on a 5 X n grid which pass through four corners ((0,0), (0,n-1), (4,n-1), (4,0)).

Examples

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

Crossrefs

Column k=5 of A333513.

Programs

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

Formula

Conjectures from Chai Wah Wu, Jan 17 2024: (Start)
a(n) = 13*a(n-1) - 45*a(n-2) + 66*a(n-3) - 17*a(n-4) - 209*a(n-5) + 151*a(n-6) + 140*a(n-7) - 112*a(n-8) - 48*a(n-9) + 50*a(n-10) + 28*a(n-11) for n > 12.
G.f.: x^2*(4*x^7 + 2*x^6 - 29*x^5 - 16*x^4 + 15*x^3 - 3*x^2 + 6*x - 1)/(28*x^11 + 50*x^10 - 48*x^9 - 112*x^8 + 140*x^7 + 151*x^6 - 209*x^5 - 17*x^4 + 66*x^3 - 45*x^2 + 13*x - 1). (End)

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

Original entry on oeis.org

1, 3, 11, 49, 229, 1081, 5123, 24323, 115567, 549253, 2610697, 12409597, 58988239, 280398495, 1332867179, 6335755801, 30116890013, 143160058769, 680508623307, 3234784886251, 15376488953815, 73091850448509, 347440733910081, 1651552982759797, 7850625988903223
Offset: 2

Views

Author

Seiichi Manyama, Mar 25 2020

Keywords

Comments

Also number of self-avoiding closed paths on a 4 X n grid which pass through four corners ((0,0), (0,n-1), (3,n-1), (3,0)).

Examples

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

Crossrefs

Column k=4 of A333513.

Programs

  • PARI
    N=40; x='x+O('x^N); Vec(x^2*(1-4*x+2*x^2+x^3)/(1-7*x+12*x^2-7*x^3+3*x^4+2*x^5))
    
  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A333513(n, k):
        universe = tl.grid(n - 1, k - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        for i in [1, k, k * (n - 1) + 1, k * n]:
            cycles = cycles.including(i)
        return cycles.len()
    def A333514(n):
        return A333513(4, n)
    print([A333514(n) for n in range(2, 15)])

Formula

G.f.: x^2*(1-4*x+2*x^2+x^3)/(1-7*x+12*x^2-7*x^3+3*x^4+2*x^5).
a(n) = 7*a(n-1) - 12*a(n-2) + 7*a(n-3) - 3*a(n-4) - 2*a(n-5) for n > 6.

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

Original entry on oeis.org

1, 41, 1081, 26515, 674292, 17720400, 471468756, 12570253556, 335101401877, 8932110760401, 238088717357193, 6346541968642151, 169176879483125528, 4509681115981777876, 120212775466066851264, 3204464007623702644476, 85420126381414152110475, 2277010595175522782497635
Offset: 2

Views

Author

Seiichi Manyama, Nov 28 2022

Keywords

Comments

Also number of self-avoiding closed paths on a 7 X n grid which pass through four corners ((0,0), (0,6), (n-1,6), (n-1,0)).

Crossrefs

Column k=7 of A333513.
Cf. A358698.

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

Original entry on oeis.org

1, 17, 229, 3105, 44930, 674292, 10217420, 154980130, 2350703747, 35658264301, 540957030465, 8206939419403
Offset: 2

Views

Author

Seiichi Manyama, Nov 28 2022

Keywords

Comments

Also number of self-avoiding closed paths on a 6 X n grid which pass through four corners ((0,0), (0,5), (n-1,5), (n-1,0)).

Crossrefs

Column k=6 of A333513.
Cf. A358697.
Showing 1-6 of 6 results.