login
Number of self-avoiding closed paths on an n X n grid which pass through all points on the two diagonals of the grid.
2

%I #20 Apr 07 2020 10:38:26

%S 1,0,6,68,6102,1404416,1094802826,2524252113468

%N Number of self-avoiding closed paths on an n X n grid which pass through all points on the two diagonals of the grid.

%C a(11) = 407977071391342237828.

%e a(2) = 1;

%e +--+

%e | |

%e +--+

%e a(4) = 6;

%e +--*--*--+ +--*--*--+ +--*--*--+

%e | | | | | |

%e *--+--+ * *--+ +--* * +--+--*

%e | | | | | |

%e *--+--+ * *--+ +--* * +--+--*

%e | | | | | |

%e +--*--*--+ +--*--*--+ +--*--*--+

%e +--*--*--+ +--* *--+ +--* *--+

%e | | | | | | | | | |

%e * +--+ * * +--+ * * + + *

%e | | | | | | | | | |

%e * + + * * +--+ * * +--+ *

%e | | | | | | | | | |

%e +--* *--+ +--* *--+ +--*--*--+

%o (Python)

%o # Using graphillion

%o from graphillion import GraphSet

%o import graphillion.tutorial as tl

%o def A333795(n):

%o universe = tl.grid(n - 1, n - 1)

%o GraphSet.set_universe(universe)

%o cycles = GraphSet.cycles()

%o points = [i + 1 for i in range(n * n) if i % n - i // n == 0 or i % n + i // n == n - 1]

%o for i in points:

%o cycles = cycles.including(i)

%o return cycles.len()

%o print([A333795(n) for n in range(2, 10)])

%Y Cf. A333455, A333464, A333466, A333796.

%K nonn,more

%O 2,3

%A _Seiichi Manyama_, Apr 05 2020