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

A274105 Triangle read by rows: T(n,k) = number of configurations of k nonattacking bishops on the black squares of an n X n chessboard (0 <= k <= n - [n>1]).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 5, 4, 1, 8, 14, 4, 1, 13, 46, 46, 8, 1, 18, 98, 184, 100, 8, 1, 25, 206, 674, 836, 308, 16, 1, 32, 356, 1704, 3532, 2816, 632, 16, 1, 41, 612, 4196, 13756, 20476, 11896, 1912, 32, 1, 50, 940, 8480, 38932, 89256, 93800, 37600, 3856, 32, 1, 61, 1440, 16940, 106772, 361780, 629336, 506600, 154256, 11600, 64
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 2016

Keywords

Comments

Rows give the coefficients of the independence polynomial of the n X n black bishop graph. - Eric W. Weisstein, Jun 26 2017

Examples

			Triangle begins:
  1;
  1,  1;
  1,  2;
  1,  5,   4;
  1,  8,  14,      4;
  1, 13,  46,     46,      8;
  1, 18,  98,    184,    100,      8;
  1, 25,  206,   674,    836,    308,     16;
  1, 32,  356,  1704,   3532,   2816,    632,     16;
  1, 41,  612,  4196,  13756,  20476,  11896,   1912,     32;
  1, 50,  940,  8480,  38932,  89256,  93800,  37600,   3856,    32;
  1, 61, 1440, 16940, 106772, 361780, 629336, 506600, 154256, 11600, 64;
  ...
Corresponding independence polynomials:
  1, (empty graph)
  1+x, (K_1)
  1+2*x, (P_2 = K_2)
  1+5*x+4*x^2, (butterfly graph)
  1+8*x+14*x^2+4*x^3,
  ...
		

Crossrefs

Alternate rows give A088960.
Row sums are A216332(n+1).
Cf. A274106 (white squares), A288183, A201862, A002465.

Programs

  • Maple
    with(combinat); with(gfun);
    T:=n->add(stirling2(n+1,n+1-k)*x^k, k=0..n);
    # bishops on black squares
    bish:=proc(n) local m,k,i,j,t1,t2; global T;
    if n<2 then return [1$(n+1)] fi;
    if (n mod 2) = 0 then m:=n/2;
    t1:=add(binomial(m,k)*T(2*m-1-k)*x^k, k=0..m);
    else
    m:=(n-1)/2;
    t1:=add(binomial(m+1,k)*T(2*m-k)*x^k, k=0..m+1);
    fi;
    seriestolist(series(t1,x,2*n+1));
    end;
    for n from 0 to 12 do lprint(bish(n)); od:
    # second Maple program:
    T:= (n,k)-> add(binomial(ceil(n/2),j)*Stirling2(n-j,n-k),j=0..k):
    seq(seq(T(n,k), k=0..n-`if`(n>1,1,0)), n=0..11);  # Alois P. Heinz, Dec 01 2024
  • Mathematica
    CoefficientList[Table[Sum[x^n Binomial[Ceiling[n/2], k] BellB[n - k, 1/x], {k, 0, Ceiling[n/2]}], {n, 10}], x] (* Eric W. Weisstein, Jun 26 2017 *)
  • SageMath
    def stirling2_negativek(n, k):
      if k < 0: return 0
      else: return stirling_number2(n, k)
    print([sum([binomial(ceil(n/2), l)*stirling2_negativek(n-l, n-k) for l in [0..k]]) for n in [0..10] for k in [0..n-1+kronecker_delta(n,1)+kronecker_delta(n,0)]]) # Eder G. Santos, Dec 01 2024

Formula

From Eder G. Santos, Dec 01 2024: (Start)
T(n,k) = Sum_{j=0..k} binomial(ceiling(n/2),j) * Stirling2(n-j,n-k).
T(n,k) = T(n-1,k) + (n-k+A000035(n)) * T(n-1,k-1), T(n,0) = 1, T(0,k) = delta(k,0). (End)

Extensions

T(0,0) prepended by Eder G. Santos, Dec 01 2024

A146304 Number of distinct ways to place bishops (up to 2n-2) on an n X n chessboard so that no bishop is attacking another and that it is not possible to add another bishop.

Original entry on oeis.org

1, 4, 10, 64, 660, 7744, 111888, 1960000, 40829184, 989479936, 27559645440, 870414361600, 30942459270912, 1225022400102400, 53716785891102720, 2589137004664520704, 136573353235553058816, 7838079929528363843584, 487668908919708442951680, 32741107405951528945844224
Offset: 1

Views

Author

Paolo Bonzini, Oct 29 2008

Keywords

Comments

Number of maximal independent vertex sets (and minimal vertex covers) in the n X n bishop graph. - Eric W. Weisstein, Jun 04 2017

Examples

			For n=2, the a(2) = 4 solutions are to place two bishops on the same row (two solutions) or column (two solutions).
		

Crossrefs

Programs

  • Mathematica
    M[sig_List, n_, k_, d_, x_] := M[sig, n, k, d, x] = If[n == 0, Boole[k == 0], If[k > 0, k*x*M[sig, n - 1, k - 1, d, x], 0] + If[k < n && sig[[n]] > d, (sig[[n]] - d)*x*M[sig, n - 1, k, d + 1, x], 0] + If[k + sig[[n]] - d < n, M[sig, n - 1, k + sig[[n]] - d, sig[[n]], x], 0]];
    Q[sig_List, x_] := M[sig, Length[sig], 0, 0, x];
    Bishop[n_, white_] := Table[n - i + If[white == 1, 1 - Mod[i, 2], Mod[i, 2]], {i, 1, n - If[white == 1, Mod[n, 2], 1 - Mod[n, 2]]}]
    a[n_] := Q[Bishop[n, 0], 1]*Q[Bishop[n, 1], 1];
    Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Jun 15 2017, translated from Andrew Howroyd's PARI code *)
  • PARI
    \\ Needs memoization - see note on algorithm for a faster version.
    M(sig,n,k,d,x)={if(n==0,k==0, if(k>0,k*x*M(sig,n-1,k-1,d,x),0) + if(kd,(sig[n]-d)*x*M(sig,n-1,k,d+1,x),0) + if(k+sig[n]-dAndrew Howroyd, Jun 05 2017

Formula

Conjectured to be a(n) = O(n^(n-1)).
a(n) = A290594(n) * A290613(n) for n > 1. - Andrew Howroyd, Aug 09 2017

Extensions

a(10)-a(11) from Andrew Howroyd, May 21 2017
Terms a(12) and beyond from Andrew Howroyd, Jun 05 2017

A216078 Number of horizontal and antidiagonal neighbor colorings of the odd squares of an n X 2 array with new integer colors introduced in row major order.

Original entry on oeis.org

1, 1, 3, 7, 27, 87, 409, 1657, 9089, 43833, 272947, 1515903, 10515147, 65766991, 501178937, 3473600465, 28773452321, 218310229201, 1949230218691, 16035686850327, 153281759047387, 1356791248984295, 13806215066685433, 130660110400259849, 1408621900803060705
Offset: 1

Views

Author

R. H. Hardin, Sep 01 2012

Keywords

Comments

Number of vertex covers and independent vertex sets of the n-1 X n-1 white bishops graph. Equivalently, the number of ways to place any number of non-attacking bishops on the white squares of an n-1 X n-1 board. - Andrew Howroyd, May 08 2017
Number of pairs of partitions (A<=B) of [n-1] such that the nontrivial blocks of A are of type {k,n-1-k} if n is even, and of type {k,n-k} if n is odd. - Francesca Aicardi, May 28 2022

Examples

			Some solutions for n = 5:
  x 0   x 0   x 0   x 0   x 0   x 0   x 0   x 0   x 0   x 0
  1 x   1 x   1 x   1 x   1 x   1 x   1 x   1 x   1 x   1 x
  x 2   x 0   x 0   x 2   x 0   x 1   x 1   x 2   x 2   x 1
  0 x   2 x   1 x   3 x   1 x   0 x   2 x   3 x   0 x   0 x
  x 3   x 1   x 2   x 2   x 0   x 1   x 1   x 1   x 2   x 0
There are 4 white squares on a 3 X 3 board. There is 1 way to place no non-attacking bishops, 4 ways to place 1 and 2 ways to place 2 so a(4) = 1 + 4 + 2 = 7. - _Andrew Howroyd_, Jun 06 2017
		

Crossrefs

Column 2 of A216084.
Row sums of A274106(n-1).

Programs

  • Maple
    a:= n-> (m-> add(binomial(m, k)*combinat[bell](m+k+e)
               , k=0..m))(iquo(n-1, 2, 'e')):
    seq(a(n), n=1..26);  # Alois P. Heinz, Oct 03 2022
  • Mathematica
    a[n_] := Module[{m, e}, {m, e} = QuotientRemainder[n - 1, 2];
       Sum[Binomial[m, k]*BellB[m + k + e], {k, 0, m}]];
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jul 25 2022, after Francesca Aicardi *)

Formula

a(n) = Sum_{k=0..m} binomial(m, k)*Bell(m+k+e), with m = floor((n-1)/2), e = (n+1) mod 2 and where Bell(n) is the Bell exponential number A000110(n). - Francesca Aicardi, May 28 2022
From Vaclav Kotesovec, Jul 29 2022: (Start)
a(2*k) = A020556(k).
a(2*k+1) = A094577(k). (End)

A216332 Number of horizontal and antidiagonal neighbor colorings of the even squares of an n X 2 array with new integer colors introduced in row major order.

Original entry on oeis.org

1, 2, 3, 10, 27, 114, 409, 2066, 9089, 52922, 272947, 1788850, 10515147, 76282138, 501178937, 3974779402, 28773452321, 247083681522, 1949230218691, 17984917069018, 153281759047387, 1510073008031682, 13806215066685433
Offset: 1

Views

Author

R. H. Hardin, Sep 04 2012

Keywords

Comments

Number of vertex covers and independent vertex sets of the n-1 X n-1 black bishops graph. Equivalently, the number of ways to place any number of non-attacking bishops on the black squares of an n-1 X n-1 board. - Andrew Howroyd, May 08 2017

Examples

			Some solutions for n=5:
..0..x....0..x....0..x....0..x....0..x....0..x....0..x....0..x....0..x....0..x
..x..1....x..1....x..1....x..0....x..1....x..1....x..0....x..1....x..1....x..0
..0..x....2..x....2..x....1..x....2..x....2..x....1..x....2..x....0..x....1..x
..x..2....x..0....x..1....x..2....x..1....x..0....x..1....x..0....x..1....x..2
..3..x....3..x....3..x....0..x....2..x....1..x....0..x....2..x....0..x....3..x
There are 5 black squares on a 3 X 3 board. There is 1 way to place no non-attacking bishops, 5 ways to place 1 and 4 ways to place 2 so a(4)=1+5+4=10. - _Andrew Howroyd_, Jun 06 2017
		

Crossrefs

Column 2 of A216338.
Row sums of A274105(n-1) for n>2.

Programs

  • Mathematica
    Table[Sum[Binomial[Ceiling[n/2], k] BellB[n - k], {k, 0, Ceiling[n/2]}], {n, 0, 20}] (* Eric W. Weisstein, Jun 25 2017 *)

A274106 Triangle read by rows: T(n,k) = total number of configurations of k nonattacking bishops on the white squares of an n X n chessboard (0 <= k <= n-1+[n=0]).

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 2, 1, 8, 14, 4, 1, 12, 38, 32, 4, 1, 18, 98, 184, 100, 8, 1, 24, 188, 576, 652, 208, 8, 1, 32, 356, 1704, 3532, 2816, 632, 16, 1, 40, 580, 3840, 12052, 16944, 9080, 1280, 16, 1, 50, 940, 8480, 38932, 89256, 93800, 37600, 3856, 32, 1, 60, 1390, 16000, 98292, 322848, 540080, 412800, 116656, 7744, 32
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 2016

Keywords

Comments

From Eder G. Santos, Dec 16 2024: (Start)
The sequence counts every possible nonattacking configuration of k bishops on the white squares of an n X n chess board.
It is assumed that the n X n chess board has a black square in the upper left corner.
(End)

Examples

			Triangle begins:
  1;
  1;
  1,  2;
  1,  4,    2;
  1,  8,   14,     4;
  1, 12,   38,    32,     4;
  1, 18,   98,   184,   100,      8;
  1, 24,  188,   576,   652,    208,      8;
  1, 32,  356,  1704,  3532,   2816,    632,     16;
  1, 40,  580,  3840, 12052,  16944,   9080,   1280,     16;
  1, 50,  940,  8480, 38932,  89256,  93800,  37600,   3856,   32;
  1, 60, 1390, 16000, 98292, 322848, 540080, 412800, 116656, 7744, 32;
  ...
From _Eder G. Santos_, Dec 16 2024: (Start)
For example, for n = 3, k = 2, the T(3,2) = 2 nonattacking configurations are:
  +---+---+---+   +---+---+---+
  |   | B |   |   |   |   |   |
  +---+---+---+   +---+---+---+
  |   |   |   | , | B |   | B |
  +---+---+---+   +---+---+---+
  |   | B |   |   |   |   |   |
  +---+---+---+   +---+---+---+
(End)
		

Crossrefs

Columns k=0-1 give: A000012, A007590.
Alternate rows give A088960.
Row sums are A216078(n+1).
T(2n,n) gives A191236.
T(2n+1,n) gives A217900(n+1).
T(n+1,n) gives A060546.
Cf. A274105 (black squares), A288182, A201862, A002465.

Programs

  • Maple
    with(combinat): with(gfun):
    T := n -> add(stirling2(n+1,n+1-k)*x^k, k=0..n):
    # bishops on white squares
    bish := proc(n) local m,k,i,j,t1,t2; global T;
        if n=0 then return [1] fi;
        if (n mod 2) = 0 then m:=n/2;
            t1:=add(binomial(m,k)*T(2*m-1-k)*x^k, k=0..m);
        else
            m:=(n-1)/2;
            t1:=add(binomial(m,k)*T(2*m-k)*x^k, k=0..m+1);
        fi;
        seriestolist(series(t1,x,2*n+1));
    end:
    for n from 0 to 12 do lprint(bish(n)); od:
  • Mathematica
    T[n_] := Sum[StirlingS2[n+1, n+1-k]*x^k, {k, 0, n}];
    bish[n_] := Module[{m, t1, t2}, If[Mod[n, 2] == 0,
       m = n/2;     t1 = Sum[Binomial[m, k]*T[2*m-1-k]*x^k, {k, 0, m}],
       m = (n-1)/2; t1 = Sum[Binomial[m, k]*T[2*m - k]*x^k, {k, 0, m+1}]];
    CoefficientList[t1 + O[x]^(2*n+1), x]];
    Table[bish[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Jul 25 2022, after Maple code *)
  • SageMath
    def stirling2_negativek(n, k):
      if k < 0: return 0
      else: return stirling_number2(n, k)
    print([sum([binomial(floor(n/2), j)*stirling2_negativek(n-j, n-k) for j in [0..k]]) for n in [0..10] for k in [0..n-1+kronecker_delta(n,0)]]) # Eder G. Santos, Dec 01 2024

Formula

From Eder G. Santos, Dec 01 2024: (Start)
T(n,k) = Sum_{j=0..k} binomial(floor(n/2),j) * Stirling2(n-j,n-k).
T(n,k) = T(n-1,k) + (n-k+1-A000035(n)) * T(n-1,k-1), T(n,0) = 1, T(0,k) = delta(k,0). (End)

Extensions

T(0,0) prepended by Eder G. Santos, Dec 01 2024

A378590 Total number of ways to place k nonattacking bishops on an n X n chess board. Triangle T(n,k) read by rows (0 <= k <= 2*n-[n>0]-[n>1]).

Original entry on oeis.org

1, 1, 1, 1, 4, 4, 1, 9, 26, 26, 8, 1, 16, 92, 232, 260, 112, 16, 1, 25, 240, 1124, 2728, 3368, 1960, 440, 32, 1, 36, 520, 3896, 16428, 39680, 53744, 38368, 12944, 1600, 64, 1, 49, 994, 10894, 70792, 282248, 692320, 1022320, 867328, 389312, 81184, 5792, 128
Offset: 0

Views

Author

Eder G. Santos, Dec 01 2024

Keywords

Comments

The sequence counts every possible nonattacking configuration of k bishops on an n x n chess board.

Examples

			Triangle begins:
  1;
  1  1;
  1  4   4;
  1  9  26    26     8;
  1 16  92   232   260    112     16;
  1 25 240  1124  2728   3368   1960     440     32;
  1 36 520  3896 16428  39680  53744   38368  12944   1600    64;
  1 49 994 10894 70792 282248 692320 1022320 867328 389312 81184 5792 128;
  ...
For example, for n = 2, k=2, the T(2,2)=4 nonattacking configurations are:
  +---+---+   +---+---+   +---+---+   +---+---+
  | B | B |   | B |   |   |   | B |   |   |   |
  +---+---+ , +---+---+ , +---+---+ , +---+---+
  |   |   |   | B |   |   |   | B |   | B | B |
  +---+---+   +---+---+   +---+---+   +---+---+
		

Crossrefs

Columns k=0-1 give: A000012, A000290.
Columns k=2-10 for n>=1 give: A172123, A172124, A172127, A172129, A176886, A187239, A187240, A187241, A187242.
Main diagonal T(n,n) gives A002465.
Row sums give A201862.
Cf. A000079.

Programs

  • SageMath
    def stirling2_negativek(n,k):
      if k < 0: return 0
      else: return stirling_number2(n,k)
    print([sum([sum([binomial(floor(n/2),i)*stirling2_negativek(n-i,n-j)*sum([binomial(ceil(n/2),l)*stirling2_negativek(n-l,n-k+j) for l in [0..k-j]]) for i in [0..j]]) for j in [0..k]]) for n in [0..10] for k in [0..2*n-2+kronecker_delta(n,1)+2*kronecker_delta(n,0)]])

Formula

T(n,k) = Sum_{j=0..k} (Sum_{i=0..j} binomial(floor(n/2),i) * Stirling2(n-i,n-j)) * (Sum_{l=0..k-j} binomial(ceiling(n/2),l) * Stirling2(n-l,n-k+j)).
T(n,2*n-2+delta(n,1)+2*delta(n,0)) = A000079(n)-delta(n,1).

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

Original entry on oeis.org

2, 9, 34, 289, 1546, 19321, 130922, 2169729, 17572114, 364466281, 3405357682, 85143154849, 896324308634, 26309790300249, 306827170866106, 10366719612433921, 132240988644215842, 5064730099043043529, 69974827707903049154, 3000912883089564050721
Offset: 1

Views

Author

Vaclav Kotesovec, Aug 28 2012

Keywords

Comments

a(n) = A002720(n) if n is odd.

Crossrefs

Programs

  • Mathematica
    Table[Sum[If[EvenQ[n],2^k*k!*Sum[Binomial[n/2,i]^2*Binomial[n/2,k-i]^2/Binomial[k,i],{i,0,k}],Binomial[n,k]^2*k!],{k,0,n}],{n,1,25}]

Formula

Recurrence: a(n) = ((12*n^5 - 158*n^4 - (6*(-1)^n-706)*n^3 - (1193-41*(-1)^n)*n^2 - 8*(7*(-1)^n-72)*n - 22*(-1)^n-28)*a(n-2) + (-12*n^6 + 206*n^5 + 2*(7*(-1)^n-691)*n^4 + (4545-137*(-1)^n)*n^3 + (442*(-1)^n-7442)*n^2 + (5194-544*(-1)^n)*n + 198*(-1)^n-698)*(n-2)*a(n-4) + 2*(2*n-1)*(n^2-7*n+10)^2*(n-4)^4*a(n-6))/(2*(n-5)^2*(2*n-5)).
Showing 1-7 of 7 results.