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

A376610 a(n) is the denominator corresponding to A376609(n).

Original entry on oeis.org

1, 5, 35, 19, 8723, 31879, 3797647, 46627015, 46174521031, 476162538587, 15682351095751655, 33959335630630535, 9299679062615813936051, 136414995946010125, 601830836638387694170497793, 26847490207486334339335997, 1114246119072163102989483761615244013, 1430040019838636422092747945537920663
Offset: 1

Views

Author

Hugo Pfoertner, Oct 03 2024

Keywords

Examples

			1, 8/5, 72/35, 46/19, 23747/8723, 94968/31879, 12161644/3797647, 158536576/46627015, 165181795263/46174521031, ...
		

Crossrefs

A376609 are the corresponding numerators.

Programs

  • PARI
    \\ Uses function droprob from A376606 and definition of kingmoves from A376609
    a376610(n) = denominator(droprob(n, kingmoves, 8))

A376606 a(n) is the numerator of the expected number of moves to reach a position outside an nXn chessboard, starting in one of the corners, when performing a random walk with unit steps on the square lattice.

Original entry on oeis.org

1, 2, 11, 10, 99, 122, 619, 4374, 187389, 482698, 11031203, 33386106, 32723853563, 139832066, 150236161755, 633573154269934, 5755694771977, 189378719187729770, 509943025510535499, 6031948951257694364778, 1044408374351599765540157091, 27891966006517951087819226666
Offset: 1

Views

Author

Ruediger Jehn and Hugo Pfoertner, Oct 03 2024

Keywords

Comments

The moves are that of chess rook with moves of unit length or of a chess king restricted to the Von Neumann 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, 2, 11/4, 10/3, 99/26, 122/29, 619/136, 4374/901, 187389/36562, 482698/89893, ...
Approximately 1, 2, 2.75, 3.333, 3.808, 4.207, 4.551, 4.855, 5.125, 5.370, 5.593, ...
		

Crossrefs

A376607 are the corresponding denominators.
A376609 and A376610 are similar for a chess king visiting the Moore neighborhood.
A376736 and A376737 are similar for a chess knight.

Programs

  • PARI
    droprob(n,moves=[[1,0],[0,1],[0,-1],[-1,0]], nmoves=4) = {my(np=n^2+1, M=matrix(np), P=1/nmoves); for(t=1, nmoves, for( i=1, n, my(ti=i+moves[t][1]); for(j=1,n,my(tj=j+moves[t][2]); my(m=(i-1)*n+j); if(ti<1 || ti>n || tj<1 || tj>n, M[m,np]+=P, my(mt=(ti-1)*n+tj); M[m,mt]+=P)))); vecsum((1/(matid(np)-M))[,1])};
    a376606(n) = numerator(droprob(n))

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

Original entry on oeis.org

1, 1, 4, 62, 269, 1766, 395497, 101338, 44125237, 227721959, 3361699348115, 483866477194862, 277887411827604127, 790848403160840410, 2785714552717079970073201, 89715505143567836216964174, 2034961072108249587083318018747, 457177774768288408431166142758841, 1085703228381446052419019696184520372520
Offset: 1

Views

Author

Hugo Pfoertner, Oct 03 2024

Keywords

Comments

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, 1, 4/3, 62/43, 269/167, 1766/1017, 395497/213488, 101338/51901, 44125237/21578387, 227721959/106983448, ...
Approximately 1, 1, 1.333, 1.442, 1.611, 1.736, 1.853, 1.953, 2.045, 2.129, 2.206, ...
		

Crossrefs

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

Programs

  • PARI
    \\ Uses function droprob from A376606
    knightmoves = [[2, 1], [1, 2], [-1, 2], [-2, 1], [-2, -1], [-1, -2], [1, -2], [2, -1]];
    a376736(n) = numerator(droprob(n, knightmoves, 8))

A378902 a(n) is the number of paths of a chess king on square a1 to reach a position outside an 8 X 8 chessboard after n steps.

Original entry on oeis.org

5, 6, 39, 156, 922, 5060, 31165, 196605, 1301490, 8844147, 61504902, 434181564, 3098427480, 22270496859, 160854381441, 1165549608378, 8463549600999, 61543303627788, 447926999731974, 3262077526200660, 23765765966223849, 173189189528260281, 1262299887268848702, 9201356346994752339
Offset: 1

Views

Author

Hugo Pfoertner, Dec 10 2024

Keywords

Comments

The king visits the Moore neighborhood, and the 8 possible moves relative to its current position are E, NE, N, NW, W, SW, S, and SE.

Examples

			a(1) = 5: only the 3 moves E, NE, and N end on target squares on the chessboard, the other 5 leave the board.
a(2) = 6: the 6 combinations of step directions leaving the board in exactly 2 moves are [E,SW], [E,S], [E,SE], [N,NE], [N,E], and [N,SE].
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{9, 9, -159, -108, 810, 900, -513, -729, -27, 81}, {5, 6, 39, 156, 922, 5060, 31165, 196605, 1301490, 8844147}, 25] (* Hugo Pfoertner, May 17 2025 *)
  • Python
    from numpy import ones, array
    P = ones((11,11),dtype=int) # transition matrix, a1=0, b1=1, c1=2, d1=3, b2=4, c2=5, d2=6, c3=7, d3=8, d4=9, off board=10
    P = [[0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 5, ],
         [1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 3, ],
         [0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 3, ],
         [0, 0, 1, 1, 0, 1, 2, 0, 0, 0, 3, ],
         [1, 2, 2, 0, 0, 2, 0, 1, 0, 0, 0, ],
         [0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, ],
         [0, 0, 1, 2, 0, 1, 1, 1, 2, 0, 0, ],
         [0, 0, 0, 0, 1, 2, 2, 0, 2, 1, 0, ],
         [0, 0, 0, 0, 0, 1, 2, 1, 2, 2, 0, ],
         [0, 0, 0, 0, 0, 0, 0, 1, 4, 3, 0, ],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]]
    pop = array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=object) # king starts in a1
    cycle = 100  # simulation period
    for i in range(cycle):
        pop = pop @ P
        print(i+1, pop[10]) # Ruediger Jehn, May 17 2025

Extensions

a(16) and beyond from Ruediger Jehn, May 17 2025
Showing 1-4 of 4 results.