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.

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)).

This page as a plain text file.
%I A333466 #37 Apr 07 2020 10:38:21
%S A333466 1,1,11,373,44930,17720400,22013629316,84579095455492
%N 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)).
%C A333466 a(11) = 36061721109572407840288. - _Seiichi Manyama_, Apr 07 2020
%e A333466 a(2) = 1;
%e A333466    +--+
%e A333466    |  |
%e A333466    +--+
%e A333466 a(3) = 1;
%e A333466    +--*--+
%e A333466    |     |
%e A333466    *     *
%e A333466    |     |
%e A333466    +--*--+
%e A333466 a(4) = 11;
%e A333466    +--*--*--+   +--*--*--+   +--*--*--+
%e A333466    |        |   |        |   |        |
%e A333466    *--*--*  *   *--*  *--*   *--*     *
%e A333466          |  |      |  |         |     |
%e A333466    *--*--*  *   *--*  *--*   *--*     *
%e A333466    |        |   |        |   |        |
%e A333466    +--*--*--+   +--*--*--+   +--*--*--+
%e A333466    +--*--*--+   +--*--*--+   +--*--*--+
%e A333466    |        |   |        |   |        |
%e A333466    *  *--*--*   *  *--*  *   *     *--*
%e A333466    |  |         |  |  |  |   |     |
%e A333466    *  *--*--*   *  *  *  *   *     *--*
%e A333466    |        |   |  |  |  |   |        |
%e A333466    +--*--*--+   +--*  *--+   +--*--*--+
%e A333466    +--*--*--+   +--*--*--+   +--*  *--+
%e A333466    |        |   |        |   |  |  |  |
%e A333466    *        *   *        *   *  *--*  *
%e A333466    |        |   |        |   |        |
%e A333466    *  *--*  *   *        *   *  *--*  *
%e A333466    |  |  |  |   |        |   |  |  |  |
%e A333466    +--*  *--+   +--*--*--+   +--*  *--+
%e A333466    +--*  *--+   +--*  *--+
%e A333466    |  |  |  |   |  |  |  |
%e A333466    *  *--*  *   *  *  *  *
%e A333466    |        |   |  |  |  |
%e A333466    *        *   *  *--*  *
%e A333466    |        |   |        |
%e A333466    +--*--*--+   +--*--*--+
%o A333466 (Python)
%o A333466 # Using graphillion
%o A333466 from graphillion import GraphSet
%o A333466 import graphillion.tutorial as tl
%o A333466 def A333466(n):
%o A333466     universe = tl.grid(n - 1, n - 1)
%o A333466     GraphSet.set_universe(universe)
%o A333466     cycles = GraphSet.cycles()
%o A333466     for i in [1, n, n * (n - 1) + 1, n * n]:
%o A333466         cycles = cycles.including(i)
%o A333466     return cycles.len()
%o A333466 print([A333466(n) for n in range(2, 10)])
%o A333466 (Ruby)
%o A333466 def search(x, y, n, used)
%o A333466   return 0 if x < 0 || n <= x || y < 0 || n <= y || used[x + y * n]
%o A333466   return 1 if x == 0 && y == 1 && [n - 1, n * (n - 1), n * n - 1].all?{|i| used[i] == true}
%o A333466   cnt = 0
%o A333466   used[x + y * n] = true
%o A333466   @move.each{|mo|
%o A333466     cnt += search(x + mo[0], y + mo[1], n, used)
%o A333466   }
%o A333466   used[x + y * n] = false
%o A333466   cnt
%o A333466 end
%o A333466 def A(n)
%o A333466   return 1 if n < 3
%o A333466   @move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
%o A333466   used = Array.new(n * n, false)
%o A333466   search(0, 0, n, used)
%o A333466 end
%o A333466 def A333466(n)
%o A333466   (2..n).map{|i| A(i)}
%o A333466 end
%o A333466 p A333466(6)
%Y A333466 Main diagonal of A333513.
%Y A333466 Cf. A003763, A140517, A333246, A333247, A333323.
%K A333466 nonn,more
%O A333466 2,3
%A A333466 _Seiichi Manyama_, Mar 22 2020