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.

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

A307026 Number of (undirected) paths in the m X n king graph (triangle read by rows with m = 1..n and n = 1..).

Original entry on oeis.org

0, 1, 30, 3, 235, 5148, 6, 1448, 96956, 6014812, 10, 7909, 1622015, 329967798, 57533191444, 15, 40674, 25281625, 16997993692, 9454839968415, 4956907379126694, 21, 202719, 375341540, 834776217484, 1482823362091281, 2480146959625512771, 3954100866385811897908
Offset: 1

Views

Author

Eric W. Weisstein, Mar 20 2019

Keywords

Comments

Paths of length zero are not counted here. - Seiichi Manyama, Dec 15 2020

Examples

			   0;
   1,    30;
   3,   235,     5148;
   6,  1448,    96956,     6014812;
  10,  7909,  1622015,   329967798, 57533191444;
  15, 40674, 25281625, 16997993692, ...;
		

Crossrefs

Row n=2..5 give: A339750, A339751, A358626, A358920.
Cf. A288033 (n X n king graph), A288518.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_nXk_king_graph(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
                if i < k:
                    grids.append((i + (j - 1) * k, i + j * k + 1))
                if i > 1:
                    grids.append((i + (j - 1) * k, i + j * k - 1))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A(start, goal, n, k):
        universe = make_nXk_king_graph(n, k)
        GraphSet.set_universe(universe)
        paths = GraphSet.paths(start, goal)
        return paths.len()
    def A307026(n, k):
        m = k * n
        s = 0
        for i in range(1, m):
            for j in range(i + 1, m + 1):
                s += A(i, j, n, k)
        return s
    print([A307026(n, k) for n in range(1, 8) for k in range(1, n + 1)])  # Seiichi Manyama, Dec 15 2020

Formula

T(1, n) = binomial(n, 2).
T(n, n) = A288033(n).

Extensions

a(20)-a(28) from Seiichi Manyama, Dec 15 2020

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

A288032 Number of (undirected) paths in the n X n grid graph.

Original entry on oeis.org

0, 12, 322, 14248, 1530196, 436619868, 343715004510, 766012555199052, 4914763477312679808, 91781780911712980966236, 5028368533802124263609489682, 813124448051069045700905179168520
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

Main diagonal of A288518.

Extensions

a(6)-a(12) from Andrew Howroyd, Jun 10 2017

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

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

Original entry on oeis.org

6, 1448, 96956, 6014812, 329967798, 16997993692, 834776217484, 39563650279918, 1823748204789500, 82228567227405462, 3641260776226602674, 158852482151721371580, 6843583319011989465314, 291698433877308327463184
Offset: 1

Views

Author

Seiichi Manyama, Dec 06 2022

Keywords

Crossrefs

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

Original entry on oeis.org

10, 7909, 1622015, 329967798, 57533191444, 9454839968415, 1482823362091281, 224616420155224372, 33098477832558055458, 4770920988514661692889, 675419680016870426617489, 94197848411355615226343472
Offset: 1

Views

Author

Seiichi Manyama, Dec 06 2022

Keywords

Crossrefs

A307025 Number of (undirected) paths in the m X n knight graph (triangle read by rows with m = 1..n and n = 1..).

Original entry on oeis.org

0, 0, 0, 0, 2, 56, 0, 4, 374, 14980, 0, 8, 2664, 302844, 19005336, 0, 12, 17556, 6530656, 1248702804, 278982789260, 0, 18, 121838, 151793054
Offset: 1

Views

Author

Eric W. Weisstein, Mar 20 2019

Keywords

Examples

			0;
0, 0;
0, 2, 56;
0, 4, 374, 14980;
0, 8, 2664, 302844, 19005336;
0, 12, 17556, 6530656, 1248702804, 278982789260;
0, 18, 121838, 151793054, ...;
		

Crossrefs

Cf. A288033 (n X n knight graph).

Formula

a(1, n) = 0.
a(2, n) = (1 - (-1)^n + 2*n*(n - 2))/4 for n > 1.
a(n, n) = A288033(n).
Showing 1-9 of 9 results.