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

A137774 Number of ways to place n nonattacking empresses on an n X n board.

Original entry on oeis.org

1, 2, 2, 8, 20, 94, 438, 2766, 19480, 163058, 1546726, 16598282, 197708058, 2586423174, 36769177348, 563504645310, 9248221393974, 161670971937362, 2996936692836754, 58689061747521430, 1210222434323163704, 26204614054454840842, 594313769819021397534, 14086979362268860896282
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 27 2011

Keywords

Comments

An empress moves like a rook and a knight.

Crossrefs

Formula

Asymptotics (Vaclav Kotesovec, Jan 26 2011): a(n)/n! -> 1/e^4.
General asymptotic formulas for number of ways to place n nonattacking pieces rook + leaper[r,s] on an n X n board:
a(n)/n! -> 1/e^2 for 0
a(n)/n! -> 1/e^4 for 0

Extensions

Terms a(16)-a(17) from Vaclav Kotesovec, Feb 06 2011
Terms a(18)-a(19) from Wolfram Schubert, Jul 24 2011
Terms a(20)-a(24) (computed by Wolfram Schubert), Vaclav Kotesovec, Aug 25 2012

A141243 Number of ways to place non-attacking knights on the n X n board.

Original entry on oeis.org

1, 2, 16, 94, 1365, 55213, 3368146, 394631712, 101693175442, 50929053498909, 48988729226134301, 96325314726538906164, 375615195988659173454092, 2933480442104347575000834468, 45480806737377995771543610802659, 1422902021111889804120495149240353936
Offset: 0

Author

Max Alekseyev, Jun 17 2008

Keywords

Comments

The maximum number of non-attacking knights is given by A030978.
Also the number of vertex covers and independent vertex sets in the n X n knight graph.

Crossrefs

Row sums of A244081.

Programs

  • Mathematica
    b[n_, l_] := b[n, l] = Module[{d, f, g, k}, d = Length[l]/3; f = False; Which[n == 0, 1, l[[1 ;; d]] == Array[f &, d], b[n - 1, Join[l[[d + 1 ;; 3*d]], Array[True &, d]]], True, For[k = 1, ! l[[k]], k++]; g = ReplacePart[l, k -> f];
         If[k > 1, g = ReplacePart[g, 2*d - 1 + k -> f]];
         If[k < d, g = ReplacePart[g, 2*d + 1 + k -> f]];
         If[k > 2, g = ReplacePart[g, d - 2 + k -> f]];
         If[k < d - 1, g = ReplacePart[g, d + 2 + k -> f]];
         Expand[b[n, ReplacePart[l, k -> f]] + b[n, g]*x]]];
    a[n_] := Function[p, Sum[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, Array[True &, n*3]]];
    Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 10}] (* Jean-François Alcover, Mar 29 2016, after Alois P. Heinz's code for A244081 *)
  • PARI
    A141243(n=4, s=n^2-1, bad=0)={ while(s && bittest(bad, s), s--);
       if(s < n, 2^(s+1-hammingweight(bad % (2<A141243(n, s-1, bad), x = s%n);
          x > 1 && bad = bitor(bad, 2^(s-n-2)); x < n-2 && bad = bitor(bad, 2^(s-n+2));
          if( s >= 2*n, x && bad = bitor(bad, 2^(s-2*n-1));
                  x < n-1 && bad = bitor(bad, 2^(s-2*n+1))
       ); cnt + A141243(n, s-1, bad))} \\ M. F. Hasler, Mar 18 2025
    
  • Python
    def A141243(n=4, start=(1,1), forbidden=()):
        if start[0] >= n: return 2**sum((n,y+1) not in forbidden for y in range(n))
        nxt = (start[0],start[1]+1) if start[1]A141243(n, nxt, forbidden)
        if start in forbidden: return cnt
        forbidden = {s for s in forbidden if s >= nxt}
        if start[1]2: forbidden |= {(start[0]+1,start[1]-2)}
        if start[0]1: forbidden |= {(start[0]+2,start[1]-1)}
        return cnt+A141243(n, nxt, forbidden) # M. F. Hasler, Mar 17 2025

Extensions

a(8)-a(13) from R. H. Hardin, Aug 25 2008
a(0) from Alois P. Heinz, Jun 19 2014
a(14) from Hiroaki Yamanouchi, Aug 28 2014
a(15) from Hiroaki Yamanouchi, Aug 29 2014

A244081 Number T(n,k) of ways to place k nonattacking knights on an n X n board; triangle T(n,k), n>=0, 0<=k<=A030978(n), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 6, 4, 1, 1, 9, 28, 36, 18, 2, 1, 16, 96, 276, 412, 340, 170, 48, 6, 1, 25, 252, 1360, 4436, 9386, 13384, 12996, 8526, 3679, 994, 158, 15, 1, 1, 36, 550, 4752, 26133, 97580, 257318, 491140, 688946, 716804, 556274, 323476, 141969, 47684, 12488, 2560, 393, 40, 2
Offset: 0

Author

Alois P. Heinz, Jun 19 2014

Keywords

Comments

In other words, the n-th row gives the coefficients of the independence polynomial of the n X n knight graph. - Eric W. Weisstein, May 05 2017

Examples

			T(4,8) = 6:
  ._______. ._______. ._______. ._______. ._______. ._______.
  |_|o|_|o| |o|_|o|_| |o|o|o|o| |o|_|_|o| |o|_|o|o| |o|o|_|o|
  |o|_|o|_| |_|o|_|o| |_|_|_|_| |o|_|_|o| |_|_|_|o| |o|_|_|_|
  |_|o|_|o| |o|_|o|_| |_|_|_|_| |o|_|_|o| |o|_|_|_| |_|_|_|o|
  |o|_|o|_| |_|o|_|o| |o|o|o|o| |o|_|_|o| |o|o|_|o| |o|_|o|o| .
.
Triangle T(n,k) begins:
  1;
  1,  1;
  1,  4,   6,    4,    1;
  1,  9,  28,   36,   18,    2;
  1, 16,  96,  276,  412,  340,   170,    48,    6;
  1, 25, 252, 1360, 4436, 9386, 13384, 12996, 8526, 3679, 994, 158, 15, 1;
  ...
As independence polynomials:
  1
  1 + x
  1 + 4*x + 6*x^2 + 4*x^3 + x^4
  1 + 9*x + 28*x^2 + 36*x^3 + 18*x^4 + 2*x^5
  1 + 16*x + 96*x^2 + 276*x^3 + 412*x^4 + 340*x^5 + 170*x^6 + 48*x^7 + 6*x^8
  ...
		

Crossrefs

Columns k=0-6 give: A000012, A000290, A172132, A172134, A172135, A172136, A178499.
T(n,n) gives A201540.
Row sums give A141243.
Cf. A030978.

Programs

  • Maple
    b:= proc(n, l) option remember; local d, f, g, k;
          d:= nops(l)/3; f:=false;
          if n=0 then 1
        elif l[1..d]=[f$d] then b(n-1, [l[d+1..3*d][], true$d])
        else for k while not l[k] do od; g:= subsop(k=f, l);
             if k>1 then g:=subsop(2*d-1+k=f, g) fi;
             if k2 then g:=subsop(  d-2+k=f, g) fi;
             if k(p->seq(coeff(p, x, i), i=0..degree(p)))(b(n, [true$(n*3)])):
    seq(T(n), n=0..7);
  • Mathematica
    b[n_, l_] := b[n, l] = Module[{d, f, g, k}, d = Length[l]/3; f = False; Which[n == 0, 1, l[[1 ;; d]] == Array[f&, d], b[n - 1, Join[l[[d + 1 ;; 3*d]], Array[True&, d]]], True, For[k = 1, !l[[k]], k++]; g = ReplacePart[l, k -> f];
         If [k > 1, g = ReplacePart[g, 2*d - 1 + k -> f]];
         If [k < d, g = ReplacePart[g, 2*d + 1 + k -> f]];
         If [k > 2, g = ReplacePart[ g, d - 2 + k -> f]];
         If [k < d - 1, g = ReplacePart[g, d + 2 + k -> f]];
         Expand[b[n, ReplacePart[l, k -> f]] + b[n, g]*x]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][
      b[n, Array[True&, n*3]]];
    Table[T[n], {n, 0, 7}] // Flatten (* Jean-François Alcover, Mar 28 2016, after Alois P. Heinz *)
    Table[Count[IndependentVertexSetQ[KnightTourGraph[n, n], #] & /@ Subsets[Range[n^2], {k}], True], {n, 4}, {k, 0, If[n == 2, 4, (1 - (-1)^n + 2 n^2)/4]}] // Flatten (* Eric W. Weisstein, May 05 2017 *)

A244284 Number of ways to place n nonattacking zebras on an n X n chessboard.

Original entry on oeis.org

1, 6, 84, 1168, 20502, 525796, 18939708, 802444170, 38934305898, 2170312156170
Offset: 1

Author

Vaclav Kotesovec, Jun 25 2014

Keywords

Comments

Zebra is a (fairy chess) leaper [2,3].

Formula

a(n) ~ n^(2*n)/n! * exp(-9/2).

A182563 Number of ways to place n non-attacking semi-knights on an n x n chessboard.

Original entry on oeis.org

1, 6, 70, 1289, 33864, 1148760, 47700972, 2344465830, 133055587660, 8559364525414, 615266768106190, 48861588247978827, 4247584874013608724, 401107335066453376830, 40880928693752664368224, 4472281486633326131737868
Offset: 1

Author

Vaclav Kotesovec, May 05 2012

Keywords

Comments

Semi-knight is a semi-leaper [1,2]. Moves of a semi-knight are allowed only in [2,1] and [-2,-1]. See also semi-bishops (A187235).

Formula

Asymptotic: a(n) ~ n^(2n)/n!*exp(-3/2).

Extensions

a(16) from Vaclav Kotesovec, May 24 2021

A243281 Number of inequivalent (mod D_8) ways to place n nonattacking knights on an n X n board.

Original entry on oeis.org

1, 2, 9, 66, 1244, 32524, 1114549, 47513547, 2401002993, 140026612346
Offset: 1

Author

Heinrich Ludwig, Jun 19 2014

Keywords

Crossrefs

A244288 Number of binary arrangements of total n 1's, without adjacent 1's on n X n array connected nw-se.

Original entry on oeis.org

1, 1, 5, 57, 1084, 29003, 999717, 42125233, 2096106904, 120194547233, 7799803041491, 564856080384900, 45146219773912540, 3946445378386791157, 374482268128153003615, 38330653031858936914329, 4209191997519328986666624, 493575737047609363968826907
Offset: 0

Author

Vaclav Kotesovec, Jun 25 2014

Keywords

Programs

  • PARI
    P(m,n) = sum(k=0, (m+1)\2, binomial(m-k+1,k)*x^k, O(x*x^n))
    a(n) = polcoef(P(n,n)*prod(m=1, n-1, P(m,n))^2, n) \\ Andrew Howroyd, Mar 27 2023

Formula

a(n) ~ n^(2*n)/n! * exp(-3/2).

Extensions

a(16) from Vaclav Kotesovec, Sep 04 2016
a(17) from Vaclav Kotesovec, Jun 15 2021
a(0)=1 prepended by Andrew Howroyd, Mar 27 2023

A245011 Number of ways to place n nonattacking princesses on an n X n board.

Original entry on oeis.org

1, 4, 6, 86, 854, 9556, 146168, 2660326, 56083228, 1349544632, 36786865968, 1117327217782
Offset: 1

Author

Vaclav Kotesovec, Sep 16 2014

Keywords

Comments

A princess moves like a bishop and a knight.
Showing 1-8 of 8 results.