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.

A272773 Number of n-step self-avoiding nonintersecting walks on the square lattice with diagonals allowed (corresponds to using the Moore neighborhood).

Original entry on oeis.org

1, 8, 56, 360, 2240, 13696, 82808, 496656, 2961136, 17573608, 103911424, 612577272, 3602222736, 21137815952, 123811421128, 724064474968, 4228582808424
Offset: 0

Views

Author

Giovanni Resta, May 06 2016

Keywords

Comments

The path cannot return to a lattice point nor intersect with itself (which IS allowed in A272763).
The Moore neighborhood characterizes king tours. - Rainer Rosenthal, Jan 06 2019

Crossrefs

Programs

  • Maple
    # For starting point stp and list Ldir of n directions (1..8)
    # construct the points of the whole path and count them.
    # In order to avoid crossings consider the n midpoints, too.
    # If there are 2*n+1 then the path is self-avoiding and uncrossed.
    isNice := proc(Ldir) local Delta, dir, ep, mp, path;
       Delta := [[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]];
       ep := [0,0]; path := {ep};
       for dir in Ldir do
          mp := ep + Delta[dir];
          ep := mp + Delta[dir];
          path := {op(path), mp, ep};
       od;
       return evalb(nops(path)=2*nops(Ldir)+1);
    end:
    # Count only king tours which are nice, i.e. self-avoiding and uncrossed.
    A272773 := proc(n) local count, T, p;
       count := 0:
       T := combinat[cartprod]([seq([$1..8], j=1..n)]):
       while not T[finished] do
          p := T[nextvalue]();
          if isNice(p) then count := count+1; fi;
       od:
       return count;
    end: # Rainer Rosenthal, Jan 06 2019
  • Mathematica
    mo = Most@Tuples[{-1, 1, 0}, 2]; a[0] = 1; a[tg_, p_: {{0, 0}}] := Block[{e, z = Last@p, w, mv = {}}, Do[w = {z+e, z+2*e}; If[Intersection[w, p] == {}, AppendTo[mv, w]], {e, mo}]; If[tg == 1, Length[mv], Sum[a[tg-1, Join[p, e]], {e, mv}]]]; a /@ Range[0, 7] (* Corrected following a suggestion by Rainer Rosenthal, Giovanni Resta, Jan 06 2019 *)

Extensions

a(5)-a(7) corrected by Rainer Rosenthal, Jan 06 2019
a(8)-a(16) from Hugo Pfoertner, Jan 06 2019

A323559 Number of rooted self-avoiding knight's paths of length n on an infinite chessboard with first move specified.

Original entry on oeis.org

1, 7, 49, 337, 2323, 15805, 107737, 727619, 4921655, 33056939, 222323989, 1487064391, 9957971965, 66391431607, 443085643919, 2946553003837, 19611967535129, 130149475953673
Offset: 1

Views

Author

Hugo Pfoertner, Jan 17 2019

Keywords

Crossrefs

A323141 Number of self-trapped uncrossed king's paths on an infinite board after n steps, reduced for symmetry.

Original entry on oeis.org

0, 0, 0, 0, 2, 19, 150, 1043, 6843, 43192, 266529, 1619983, 9746883, 58220994, 345919915
Offset: 1

Views

Author

Hugo Pfoertner, Jan 05 2019

Keywords

Comments

The average number of moves of a self-avoiding uncrossed random walk of a king on an infinite chessboard to self-trapping is 69.865+-0.008. - Hugo Pfoertner, Oct 22 2024

Examples

			a(5) = 2: There are 2 walks where the king is blocked after 5 steps, because for the diagonal moves it would have to cross its previous path.
.
  o       2       o       o       3        o
        /   \                   /   \
      /       \               /        \
    /           \           /            \
  3       5       1       4 - - - 5        2
  |     /       /                        /
  |   /       /                        /
  | /       /                        /
  4       S       o       S - - -  1       o
		

Crossrefs

A376609 a(n) is the numerator of the expected number of random moves of a chess king to reach a position outside an nXn chessboard, starting in one of the corners.

Original entry on oeis.org

1, 8, 72, 46, 23747, 94968, 12161644, 158536576, 165181795263, 1779861954248, 60921563004721184, 136512657826472304, 38548316743830620183051, 581371653539561314, 2630585854108441990301102856, 120104329127347395409698056, 5092493809189909792181005355935991197, 6666722670813237580783418910187983288
Offset: 1

Views

Author

Hugo Pfoertner, Oct 03 2024

Keywords

Comments

The king visits the Moore neighborhood (see A272763). The piece does not pay attention to its position and will fall off the board if it makes a move beyond the edge of the board.

Examples

			1, 8/5, 72/35, 46/19, 23747/8723, 94968/31879, 12161644/3797647, 158536576/46627015, 165181795263/46174521031, ...
Approximately 1, 1.6, 2.057, 2.421, 2.722, 2.979, 3.202, 3.400, 3.577, 3.738, ...
		

Crossrefs

A376610 are the corresponding denominators.
A376606 and A376607 are similar for a rook walk with unit steps.
A376736 and A376737 are similar for a chess knight.

Programs

  • PARI
    \\ Uses function droprob from A376606
    kingmoves = [[1, 0], [0, 1], [0, -1], [-1, 0], [-1, -1], [-1, 1], [1, -1], [1, 1]];
    a376609(n) = numerator(droprob(n,kingmoves,8))

A323561 Number of rooted self-avoiding king's walks of n moves on an infinite chessboard with first move specified.

Original entry on oeis.org

2, 14, 92, 584, 3644, 22482, 137626, 837466, 5072590, 30611376, 184171252, 1105262004, 6618842522, 39564403462, 236123357538, 1407249202976, 8376673823516
Offset: 1

Views

Author

Hugo Pfoertner, Jan 17 2019

Keywords

Comments

The first move is either (0,0) -> (1,0) or (0,0) -> (1,1). Rotated paths are not counted separately.

Crossrefs

Showing 1-5 of 5 results.