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

A323140 Number of uncrossed king's paths of length n, reduced for symmetry, A272773/8.

Original entry on oeis.org

1, 7, 45, 280, 1712, 10351, 62082, 370142, 2196701, 12988928, 76572159, 450277842, 2642226994, 15476427641, 90508059371
Offset: 1

Views

Author

Hugo Pfoertner, Jan 05 2019

Keywords

Comments

For comments, programs, references see A272773.

Crossrefs

Formula

a(n) = A272773(n) / 8.

A323131 Number of uncrossed rooted knight's paths of length n on an infinite board.

Original entry on oeis.org

1, 7, 47, 303, 1921, 11963, 74130, 454484, 2779152, 16882278, 102384151, 618136584, 3727827148, 22408576099, 134595908277, 806452390868
Offset: 1

Views

Author

Hugo Pfoertner, Jan 05 2019

Keywords

Comments

The direction of the first move is kept fixed.
The average number of steps of a random walk using such knight moves with forbidden crossing is 45 (compare to A322831).

Examples

			a(1) = 1: The fixed initial move.
a(2) = 7: Relative to the direction given by the initial move, there are 7 possible direction changes. The backward direction is illegal for the self-avoiding uncrossed path. Only for the right angle turn its mirror image would coincide with the turn in the opposite direction. Therefore this move would be eliminated in the unrooted walks, making a(2) > A323132(2) = 6.
a(3) = 47: 2 of all 7*7 = 49 continuation moves already lead to a crossing of the first path segment.
See illustrations at Pfoertner link.
		

Crossrefs

Extensions

Erroneous (as pointed out by Bert Dobbelaere) a(8) and a(10) corrected by Hugo Pfoertner, Jan 18 2019
a(12)-a(16) from Bert Dobbelaere, Jan 18 2019

A272763 Number of n-step self-avoiding walks on the square lattice with diagonals allowed (Moore neighborhood).

Original entry on oeis.org

1, 8, 56, 368, 2336, 14576, 89928, 550504, 3349864, 20290360, 122445504, 736685008, 4421048016, 26475370088, 158257613848, 944493430152, 5628996811904
Offset: 0

Views

Author

Francois Alcover, May 05 2016

Keywords

Comments

Moore neighborhood :
o o o
o x o
o o o
Von Neumann neighborhood (A001411):
o
o x o
o
Note that the path avoids already visited lattice points, but can intersect itself (two diagonal steps). A nonintersecting version is A272773.
The Moore neighborhood characterizes king tours. # Rainer Rosenthal, Jan 05 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.
    # If there are n+1 then the path is self-avoiding.
    isSelfAvoiding := proc(Ldir) local Delta, dir, ep, 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
          ep := ep + Delta[dir];
          path := {op(path), ep};
       od;
       return evalb(nops(path)=nops(Ldir)+1);
    end:
    # Count only king tours which are self-avoiding
    A272763 := 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 isSelfAvoiding(p) then count := count+1; fi;
       od:
       return count;
    end: # Rainer Rosenthal, Jan 05 2019
  • Mathematica
    mo=Most@Tuples[{-1,1,0},2]; a[0]=1; a[tg_, p_: {{0, 0}}] := Block[{e, mv = Complement[Last[p] + # & /@ mo, p]}, If[tg == 1, Length@mv, Sum[a[tg - 1, Append[p, e]], {e, mv}]]]; a /@ Range[0, 7] (* Giovanni Resta, May 06 2016 *)

Extensions

a(13)-a(16) from Giovanni Resta, May 06 2016

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

A323132 Number of uncrossed unrooted knight's paths of length n on an infinite board.

Original entry on oeis.org

1, 6, 25, 160, 966, 6018, 37079, 227357
Offset: 1

Views

Author

Hugo Pfoertner, Jan 05 2019

Keywords

Comments

Paths which are equivalent under rotation, reflection or reversal are counted only once.

Examples

			See illustrations at Pfoertner link.
		

Crossrefs

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

A300665 Number of n-step paths made by a chess king, starting from the corner of an infinite chessboard, and never revisiting a cell.

Original entry on oeis.org

1, 3, 15, 75, 391, 2065, 11091, 60215, 330003, 1820869, 10103153, 56313047, 315071801, 1768489771, 9953853677, 56158682949, 317505199769, 1798402412539
Offset: 0

Views

Author

Ricardo Bittencourt, Mar 10 2018

Keywords

Comments

All terms are odd.

Examples

			For n=2, the a(2)=15 paths are:
.
.    0 . .     0 . .     0 . .     0 2 .     0 . .
.    |         |         |         |/         \
.    1 . .     1 . .     1-2 .     1 . .     2-1 .
.    |          \
.    2 . .     . 2 .     . . .     . . .     . . .
.
.    0 . .     0 . .     0 . .     0 . .     0 . 2
.     \         \         \         \         \ /
.    . 1 .     . 1 .     . 1 .     . 1-2     . 1 .
.     /          |          \
.    2 . .     . 2 .     . . 2     . . .     . . .
.
.    0 2 .     0-1 .     0-1 .     0-1 .     0-1-2
.     \|        /          |          \
.    . 1 .     2 . .     . 2 .     . . 2     . . .
.
.    . . .     . . .     . . .     . . .     . . .
		

Crossrefs

A038373 is the same process, but using only horizontal and vertical moves.

Programs

  • Go
    (see GitHubGist link)
  • Mathematica
    next[x_]:=Map[x + #&, Tuples[{-1, 0, 1}, 2]]
    valid[s_]:=Select[next[s[[-1]]], 0<=#[[1]] && 0<=#[[2]] && FreeQ[s,#] &]
    nextpath[p_]:=Outer[Append,{p},valid[p],1]
    iterate[p_]:=Flatten[Map[nextpath, p], 2]
    Table[Length[Nest[iterate, {{{0,0}}}, n-1]], {n,1,7}]

Formula

a(n) = A272469(n) + 2*A005773(n+1) - 1 for n > 0. - Andrey Zabolotskiy, Mar 12 2018

A344813 Square of the distance from the origin for a square lattice Moore neighborhood self-avoiding walk using the rules given in the Comments.

Original entry on oeis.org

0, 1, 5, 13, 25, 18, 32, 50, 41, 61, 85, 72, 98, 85, 61, 74, 100, 89, 65, 80, 58, 73, 97, 90, 116, 106, 117, 149, 130, 113, 145, 181, 162, 128, 145, 113, 130, 164, 149, 117, 136, 106, 125, 97, 73, 90, 68, 50, 36, 50, 37, 53, 73, 58, 80, 106, 89, 117, 100, 74, 52, 34, 20, 10, 17, 9, 17, 10, 4, 5
Offset: 1

Views

Author

Eric Angelini and Scott R. Shannon, May 29 2021

Keywords

Comments

On a square lattice, where the walk can step to any of the eight unvisited nearest neighboring points (Moore neighborhood), start at the origin on the square numbered 1 and then step directly north to a square numbered 2. From then on sum the numbers in the last two visited squares, where each square is numbered with the next distinct integer after 2 as it is visited. If that sum is a prime number, the next step is to an unvisited square that is as far away from the origin as possible. If the sum is not prime then step to an unvisited square as close as possible to the origin. In either case if two squares exist that are the same distance from the origin then step to the square that is as far away from, if the sum is prime, or as close to, if the sum is composite, to the square with number 2. If these distances are the same, then step similarly to the square with number 3.
The sequence gives the square of the distance from the origin for the visited squares of this walk. The sequence is finite. After 128 steps, 129 visited squares, the walk ends as all eight neighboring squares have been visited.

Examples

			a(3) = 5. The second square has coordinates (0,1) and the sum of the first two numbers is 1 + 2 = 3, which is prime. Therefore, to move as far away from the origin as possible, a step to (1,2) is taken, which has a square distance of 5 units from the origin. Note that a step to (-1,2) could have also been taken and would lead to the same walk by symmetry.
a(6) = 18 as a(5) is at coordinates (3,4) and the sum of the last two square numbers is 4 + 5 = 9, which is composite. Therefore, to step to a square as close as possible to the origin, a step to (3,3) is taken, which has a square distance of 18 units from the origin.
a(9) = 41 as a(8) is at coordinates (5,5) and the sum of the last two square numbers is 7 + 8 = 15, which is composite. Two squares as close as possible to the origin are available, (4,5) and (5,4), both of which have a square distance from the origin of 41 units. Since (4,5) has a square distance of 32 units from the square numbered 2, and (5,4) has a square distance of 34 units from 2, the former is chosen.
		

Crossrefs

Showing 1-9 of 9 results.