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

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

Views

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

A212269 Number of ways to place k non-attacking kings on an n X n cylindrical chessboard, summed over all k >= 0.

Original entry on oeis.org

2, 5, 19, 205, 3011, 92875, 4763459, 459630701, 78223965193, 24270274906085, 13497818986883771, 13571363009654254429, 24562890586806439035377, 80199120146273882569630015, 471874707649862024071657639861, 5005895207027974222377733802848093
Offset: 1

Views

Author

Vaclav Kotesovec, May 12 2012

Keywords

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 343.

Crossrefs

Formula

Limit n ->infinity (a(n))^(1/n^2) = 1.342643951124... (see A247413).

A212270 Number of ways to place k non-attacking wazirs on an n x n cylindrical chessboard, summed over all k >= 0.

Original entry on oeis.org

2, 7, 43, 933, 36211, 3557711, 746156517, 363549830913, 394677987525997, 974602314570939359, 5418730454986467701985, 68176187476467835406646029, 1936241516342334422813929891295, 124281423643836238320564876791634465, 18018270577720149773239661332878801006033
Offset: 1

Views

Author

Vaclav Kotesovec, May 12 2012

Keywords

Comments

Wazir is a leaper [0,1].

Crossrefs

Main diagonal of A286513.

Formula

Limit n ->infinity (a(n))^(1/n^2) is the hard square entropy constant A085850.

A212271 Number of ways to place k non-attacking ferses on an n x n cylindrical chessboard, summed over all k >= 0.

Original entry on oeis.org

2, 9, 80, 1600, 79033, 8156736, 2055960192, 1108756350625, 1411080429618656, 3943472747846953216, 25425527581172360096017, 365481944233773616212640000, 11980566143208960475692367828480, 882106482533191605447029340350009049, 147314997388032765439791110273770608260928
Offset: 1

Views

Author

Vaclav Kotesovec, May 12 2012

Keywords

Comments

Fers is a leaper [1,1].

Crossrefs

Formula

Limit n ->infinity (a(n))^(1/n^2) is the hard square entropy constant A085850.

A182408 Number of ways to place k non-attacking knights on an n x n toroidal chessboard, summed over all k >= 0.

Original entry on oeis.org

2, 7, 34, 743, 1546, 598078, 6027057, 10163241031, 242407820869
Offset: 1

Views

Author

Vaclav Kotesovec, May 09 2012

Keywords

Crossrefs

Showing 1-5 of 5 results.