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.

A140518 Number of simple paths from corner to corner of an n X n grid with king-moves allowed.

Original entry on oeis.org

1, 5, 235, 96371, 447544629, 22132498074021, 10621309947362277575, 50819542770311581606906543, 2460791237088492025876789478191411, 1207644919895971862319430895789323709778193, 5996262208084349429209429097224046573095272337986011
Offset: 1

Views

Author

Don Knuth, Jul 26 2008

Keywords

Comments

This graph is the "strong product" of P_n with P_n, where P_n is a path of length n. Sequence A007764 is what we get when we restrict ourselves to rook moves of unit length.
Computed using ZDDs (ZDD = "reduced, order, zero-suppressed binary decision diagram").

Examples

			For example, when n=8 this is the number of ways to move a king from a1 to h8 without occupying any cell twice.
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, fascicle 1, section 7.1.4, p. 117, Addison-Wesley, 2009.

Crossrefs

Main diagonal of A329118.
Cf. A220638 (Hosoya index).

Extensions

a(9)-a(11) from Andrew Howroyd, Apr 07 2016

A288033 Number of (undirected) paths in the n X n king graph.

Original entry on oeis.org

0, 30, 5148, 6014812, 57533191444, 4956907379126694, 3954100866385811897908, 29986588563791584765930866780, 2187482261973324160097873804506155572, 1550696105068168200375810546149511240714556526
Offset: 1

Views

Author

Eric W. Weisstein, Jun 04 2017

Keywords

Comments

Paths of length zero are not counted here. - Andrew Howroyd, Jun 10 2017

Crossrefs

Extensions

a(5)-a(10) from Andrew Howroyd, Jun 10 2017

A329118 Array read by antidiagonals: T(m, n) is the number of simple paths from corner to diagonally opposite corner on an m X n grid with king moves allowed.

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 24, 24, 1, 1, 116, 235, 116, 1, 1, 560, 2922, 2922, 560, 1, 1, 2704, 38169, 96371, 38169, 2704, 1, 1, 13056, 494596, 3764367, 3764367, 494596, 13056, 1, 1, 63040, 6375379, 150610151, 447544629, 150610151, 6375379, 63040, 1, 1, 304384, 82191766, 5898799685, 56182569218, 56182569218, 5898799685, 82191766, 304384, 1
Offset: 1

Views

Author

Andrew Howroyd, Nov 05 2019

Keywords

Examples

			Array begins:
===================================================================
m\n | 1     2       3          4             5                6
----+--------------------------------------------------------------
  1 | 1     1       1          1             1                1 ...
  2 | 1     5      24        116           560             2704 ...
  3 | 1    24     235       2922         38169           494596 ...
  4 | 1   116    2922      96371       3764367        150610151 ...
  5 | 1   560   38169    3764367     447544629      56182569218 ...
  6 | 1  2704  494596  150610151   56182569218   22132498074021 ...
  7 | 1 13056 6375379 5898799685 6972159602221 8656506756327178 ...
  ...
		

Crossrefs

Main diagonal is A140518.

A272445 Numbers of paths for moving a king from a corner to the opposite one in an n X n chessboard, provided that each cell must be reached exactly once.

Original entry on oeis.org

1, 2, 30, 4942, 5853876, 58039036412, 4458135334234700, 2811002302704446996926, 14204916761279146343474398608, 580077332863329104087361516015280826, 190934226579364879405564404836420471442186330, 507088717315287736410992294230305692212344811974323748
Offset: 1

Views

Author

César Eliud Lozada, Apr 29 2016

Keywords

Examples

			On a 2 X 2 chessboard, the king has 2 paths to go from a corner to the opposite one, standing exactly one time on each cell, so a(2)=2.
On a 3 X 3 chessboard, the king has 30 paths to go from a corner to the opposite one, standing exactly one time on each cell, so a(3)=30.
		

Crossrefs

Programs

  • Maple
    ChessKingPaths := proc(N, aUsed:=[1])
      local nLast, nPrev,  nNext,  i, j, i1, j1, i2, j2:
      global aPath, nPaths;
    if N=1 then
      aPath:=[[1]]; nPaths:=1; return nPaths;
    end if:
      if aUsed=[1] then
        aPath:=[]; nPaths:=0;
      end if;
      nLast:=N^(2);   #`opposite corner`
      nPrev := aUsed[-1] ; #actual position
      #Check all possible next cells
      i1:=`if`(floor((nPrev-1)/N)=0,0,-N); i2:=`if`(floor((nPrev-1)/N)=N-1,0,N);
      j1:=`if`((nPrev-1)mod N=0,0,-1); j2:=`if`((nPrev-1) mod N=N-1,0,1);
      for i from i1 to i2 by N do
        for j from j1 to j2 by 1 do
          if i=0 and j=0 then next fi; #`no move`
          nNext:=nPrev+i+j;
          #`out of bounds or already visited`
          if nNext<1 or nNext>nLast or (nNext in aUsed) then next: fi;
          #`nLast must be the last one`
          if (nNext=nLast and nops(aUsed)<>nLast-1) then next fi:
          if nNext=nLast  and nops(aUsed)=nLast-1 then  #`path completed`
            #comment if list is not required. It will consume all memory for N>=5
            aPath:=[op(aPath), [op(aUsed),nNext]];
            nPaths:=nPaths+1;
            break:
          else
            ChessKingPaths(N,[op(aUsed),nNext]) #move and continue
          end if;
        end do:
      end do:
      return nPaths;
    end proc:
    #For a(n) call this function with parameter n.
    #Examples: ChessKingPaths(2), ChessKingPaths(3),...
    #The list of paths is stored in variable aPath.

Extensions

a(5)-a(11) from Andrew Howroyd, Jun 19 2017
a(12) from Ed Wynn, Jul 08 2023

A308129 Number of (undirected) Hamiltonian paths on the n X n king graph.

Original entry on oeis.org

1, 12, 392, 171592, 364618672, 6544911081900, 829555065360355292, 817534730458899350635436, 6154392250018061759082363305112, 360916610325065945171647827293872547848, 165298493343313203241690299664254975948394404072
Offset: 1

Views

Author

Eric W. Weisstein, May 14 2019

Keywords

Crossrefs

Main diagonal of A350729.

Formula

a(n) = A158651(n)/2 for n > 1.

Extensions

a(1) corrected by Andrew Howroyd, Jan 16 2022

A096969 Number of ways to number the cells of an n X n square grid with 1,2,3,...,n^2 so that successive integers are in adjacent cells (horizontally or vertically).

Original entry on oeis.org

1, 8, 40, 552, 8648, 458696, 27070560, 6046626568, 1490832682992, 1460089659025264, 1573342970540617696, 6905329711608694708440, 33304011435341069362631160, 663618176813467308855850585056, 14527222735920532980525200234503048
Offset: 1

Views

Author

John W. Layman, Jul 16 2004, at the suggestion of Leroy Quet, Jul 05 2004

Keywords

Comments

Number of directed Hamiltonian paths in (n X n)-grid graph. - Max Alekseyev, May 03 2009

Examples

			One of the 8648 numberings of a 5 X 5 grid is
.
  3---2---1  20--21
  |           |   |
  4  17--18--19  22
  |   |           |
  5  16--15--14  23
  |           |   |
  6   9--10  13  24
  |   |   |   |   |
  7---8  11--12  25
		

Crossrefs

Formula

Conjecture: Limit_{n->oo} log_(n+1)!(a(n+1)) - log_n!(a(n)) = c, where 0.09 < c < 0.11. - Nicolas Bělohoubek, Jun 12 2022

Extensions

a(7) from Giovanni Resta, May 12 2006
a(8)-a(15) added by Andrew Howroyd, Dec 20 2015

A234622 Numbers of undirected cycles in the n X n king graph.

Original entry on oeis.org

7, 348, 136597, 545217435, 21964731190911, 9389890985897322572, 41930442683035614068268389, 1912714607714074785106312737308553, 888957501697133413663023517792044869026260, 4209348789084188565760570660849691414465827388642586
Offset: 2

Views

Author

Eric W. Weisstein, Dec 28 2013

Keywords

Crossrefs

Extensions

a(7)-a(11) from Andrew Howroyd, Apr 06 2016

A236690 Number of simple directed paths on an n X n king graph.

Original entry on oeis.org

1, 64, 10305, 12029640, 115066382913, 9913814758253424, 7908201732771623795865, 59973177127583169531861733624, 4374964523946648320195747609012311225, 3101392210136336400751621092299022481429113152
Offset: 1

Views

Author

Jaimal Ichharam, Jan 30 2014

Keywords

Comments

This is the number (assuming each character is unique) of strings that are possible in an n X n Boggle grid.
This sequence gives the number of directed paths. Paths may start and end on any vertex and may be of any length. Paths of length zero are counted here. - Andrew Howroyd, May 12 2017

Crossrefs

Cf. A236753 for a simpler version of the problem without diagonal edges.

Formula

a(n) = 2*A288033(n) + n^2. - Andrew Howroyd, Jun 10 2017

Extensions

a(5) from Jaimal Ichharam, Feb 12 2014
Named edited and a(6)-a(10) from Andrew Howroyd, May 12 2017

A338426 a(n) is the number of paths a chess king can take from (0,0) to (n+1,0) touching each point in {-1,0,1} X {1,2,...,n} exactly once.

Original entry on oeis.org

1, 2, 28, 154, 1206, 8364, 60614, 432636, 3104484, 22235310, 159360540, 1141875800, 8182608226, 58634396372, 420162632840, 3010793013534, 21574706493988, 154599722419136, 1107828637412194, 7938463325113516, 56885333141857872, 407628148378295190
Offset: 0

Views

Author

Peter Kagey, Oct 25 2020

Keywords

Examples

			For n = 1, the a(1) = 2 paths are (0,0)->(1,1)->(1,0)->(1,-1)->(2,0) and (0,0)->(1,-1)->(1,0)->(1,1)->(2,0).
An example of one of the a(2) = 28 paths is (0,0)->(1,1)->(2,1)->(2,0)->(1,-1)->(1,0)->(2,-1)->(3,0).
		

Crossrefs

Formula

a(n) = 7*a(n-1) + 6*a(n-2) - 39*a(n-3) + 29*a(n-4) + 28*a(n-5) - 26*a(n-6) - 10*a(n-7) + 6*a(n-8) for n >= 8.
Showing 1-9 of 9 results.