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-10 of 12 results. Next

A172225 Number of ways to place 2 nonattacking wazirs on an n X n board.

Original entry on oeis.org

0, 2, 24, 96, 260, 570, 1092, 1904, 3096, 4770, 7040, 10032, 13884, 18746, 24780, 32160, 41072, 51714, 64296, 79040, 96180, 115962, 138644, 164496, 193800, 226850, 263952, 305424, 351596, 402810, 459420, 521792, 590304
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 29 2010

Keywords

Comments

A wazir is a (fairy chess) leaper [0,1].

References

  • Christian Poisson, Echecs et mathematiques, Rex Multiplex 29/1990, p. 829.

Crossrefs

Programs

  • Magma
    I:=[0, 2, 24, 96, 260]; [n le 5 select I[n] else 5*Self(n-1)-10*Self(n-2)+10*Self(n-3)-5*Self(n-4)+Self(n-5): n in [1..40]]; // Vincenzo Librandi, Apr 30 2013
    
  • Magma
    [n*(n-1)*(n^2+n-4)/2: n in [1..40]]; // Vincenzo Librandi, Apr 30 2013
  • Mathematica
    Table[n (n - 1) (n^2 + n - 4) / 2, {n, 40}] (* Vincenzo Librandi, Apr 30 2013 *)
    LinearRecurrence[{5,-10,10,-5,1},{0,2,24,96,260},40] (* Harvey P. Dale, Jun 04 2023 *)

Formula

Explicit formula (Christian Poisson, 1990): a(n) = n*(n-1)*(n^2+n-4)/2.
G.f.: 2*x^2*(2*x^2-7*x-1)/(x-1)^5. - Vaclav Kotesovec, Mar 25 2010
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5). - Vincenzo Librandi, Apr 30 2013
a(n) = 2*A239352(n). - R. J. Mathar, Jan 09 2018
a(n) = A232833(n,2). - R. J. Mathar, Apr 11 2024

A172134 Number of ways to place 3 nonattacking knights on an n X n board.

Original entry on oeis.org

0, 4, 36, 276, 1360, 4752, 13340, 32084, 68796, 135040, 247152, 427380, 705144, 1118416, 1715220, 2555252, 3711620, 5272704, 7344136, 10050900, 13539552, 17980560, 23570764, 30535956, 39133580, 49655552, 62431200, 77830324
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 26 2010

Keywords

References

  • E. Bonsdorff, K. Fabel, O. Riihimaa, Schach und Zahl, 1966, p. 51-63

Crossrefs

Column k=3 of A244081.

Programs

  • Magma
    [n le 3 select (n*(n-1))^2 else (n-2)*(n+5)*(n^4 -3*n^3 -8*n^2 +66*n -108)/6: n in [1..50]]; // G. C. Greubel, Apr 18 2022
    
  • Mathematica
    CoefficientList[Series[4x(3x^8 -20x^7 +43x^6 -38x^5 +23x^4 -11x^3 -27x^2 -2x -1)/ (x-1)^7, {x, 0, 40}], x] (* Vincenzo Librandi, May 02 2013 *)
  • SageMath
    def A172134(n):
        if (n<4): return (n*(n-1))^2
        else: return (n-2)*(n+5)*(n^4 -3*n^3 -8*n^2 +66*n -108)/6
    [A172134(n) for n in (1..50)] # G. C. Greubel, Apr 18 2022

Formula

Explicit formula (Karl Fabel, 1966): a(n) = (n - 2)*(n + 5)*(n^4 - 3*n^3 - 8*n^2 + 66*n - 108)/6, for n >= 4.
G.f.: 4*x^2*(3*x^8-20*x^7+43*x^6-38*x^5+23*x^4-11*x^3-27*x^2-2*x-1)/(x-1)^7. - Vaclav Kotesovec, Mar 25 2010
From G. C. Greubel, Apr 18 2022: (Start)
a(n) = 7*a(n-1) -21*a(n-2) +35*a(n-3) -35*a(n-4) +21*a(n-5) -7*a(n-6) +a(n-7), for n >= 11.
E.g.f.: (1/6)*(-1080 - 312*x + 12*x^2 +13*x^3 + (1080 - 768*x + 228*x^2 + 38*x^4 + 15*x^5 + x^6)*exp(x)). (End)

A172135 Number of ways to place 4 nonattacking knights on an n X n board.

Original entry on oeis.org

0, 1, 18, 412, 4436, 26133, 111066, 376560, 1080942, 2732909, 6253408, 13204356, 26100160, 48819677, 87137934, 149398608, 247349946, 397168485, 620696612, 946921684, 1413726108, 2069939461, 2977725410, 4215337872
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 26 2010

Keywords

References

  • E. Bonsdorff, K. Fabel, O. Riihimaa, Schach und Zahl, 1966, p. 51-63

Crossrefs

Column k=4 of A244081.

Programs

  • Magma
    [0,1,18,412,4436] cat [(n^8 -54*n^6 +144*n^5 +1019*n^4 -5232*n^3 -2022*n^2 +51120*n -77184)/24: n in [6..50]]; // G. C. Greubel, Apr 19 2022
    
  • Mathematica
    CoefficientList[Series[x*(1 +9*x +286*x^2 +1292*x^3 -345*x^4 +3099*x^5 -5142*x^6 +3606*x^7 -1162*x^8 -390*x^9 +690*x^10 -312*x^11 +48*x^12)/(1-x)^9, {x, 0, 40}], x] (* Vincenzo Librandi, May 26 2013 *)
  • SageMath
    [0,1,18,412,4436] + [(n^8 -54*n^6 +144*n^5 +1019*n^4 -5232*n^3 -2022*n^2 +51120*n -77184)/24 for n in (6..50)] # G. C. Greubel, Apr 19 2022

Formula

a(n) = (n^8 - 54*n^6 + 144*n^5 + 1019*n^4 - 5232*n^3 - 2022*n^2 + 51120*n - 77184)/24, n >= 6. (Karl Fabel, 1966)
G.f.: x^2 * ( 1 + 9*x + 286*x^2 + 1292*x^3 - 345*x^4 +3099*x^5 - 5142*x^6 + 3606*x^7 - 1162*x^8 - 390*x^9 + 690*x^10 - 312*x^11 + 48*x^12) / (1-x)^9. - Vaclav Kotesovec, Mar 25 2010
E.g.f.: x^2/2! + 18*x^3/3! + 412*x^4/4! + 4436*x^5/5! + (1/120)*(385920 + 161040*x + 17940*x^2 - 1200*x^3 - 2660*x^4 - 4484*x^5 + (-385920 + 224880*x - 49860*x^2 + 2940*x^3 + 3250*x^4 + 1920*x^5 + 1060*x^6 + 140*x^7 + 5*x^8)*exp(x)). - G. C. Greubel, Apr 19 2022

A172136 Number of ways to place 5 nonattacking knights on an n X n board.

Original entry on oeis.org

0, 0, 2, 340, 9386, 97580, 649476, 3184708, 12472084, 41199404, 119171110, 309957412, 739123094, 1639655452, 3422020324, 6778432292, 12833460256, 23356032940, 41051290730, 69954580804
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 26 2010

Keywords

Comments

For any fixed value of k>1, a(n) = n^(2*k) /k! - 9*n^(2*k - 2) /2/(k - 2)! + 12*n^(2*k - 3) /(k - 2)! + ...

Crossrefs

Column k=5 of A244081.

Programs

  • Mathematica
    CoefficientList[Series[2x^2(74 x^15 -518x^14 +1110x^13 +1046x^12 -11332x^11 + 29950x^10 -42430x^9 +32476x^8 -11684x^7 -1000x^6 +15021x^5 -18443x^4 -6352x^3 - 2878x^2 -159x -1)/(x-1)^11, {x,0,40}], x] (* Vincenzo Librandi, May 02 2013 *)
  • SageMath
    [0,0,2,340,9386,97580,649476] + [(n^10 -90*n^8 +240*n^7 +3235*n^6 - 16320*n^5 -40530*n^4 +396480*n^3 -231656*n^2 -3359520*n +6509280)/120 for n in (8..50)] # G. C. Greubel, Apr 19 2022

Formula

Explicit formula: a(n) = (n^10 - 90*n^8 + 240*n^7 + 3235*n^6 - 16320*n^5 - 40530*n^4 + 396480*n^3 - 231656*n^2 - 3359520*n + 6509280)/120, n >= 8.
G.f.: 2*x^3 * (74*x^15 -518*x^14 +1110*x^13 +1046*x^12 -11332*x^11 +29950*x^10 -42430*x^9 +32476*x^8 -11684*x^7 -1000*x^6 +15021*x^5 -18443*x^4 -6352*x^3 -2878*x^2 -159*x -1) / (x-1)^11. [Vaclav Kotesovec, Mar 25 2010]

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

Views

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 *)

A172141 Number of ways to place 2 nonattacking nightriders on an n X n board.

Original entry on oeis.org

0, 6, 28, 96, 240, 518, 980, 1712, 2784, 4310, 6380, 9136, 12688, 17206, 22820, 29728, 38080, 48102, 59964, 73920, 90160, 108966, 130548, 155216, 183200, 214838, 250380, 290192, 334544, 383830, 438340, 498496, 564608, 637126
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 26 2010

Keywords

Comments

A nightrider is a fairy chess piece that can move (proportionate to how a knight moves) in any direction.

References

  • Christian Poisson, Echecs et mathematiques, Rex Multiplex 29/1990, p.829

Crossrefs

Programs

  • Magma
    [(n/12)*(3*(-1)^n -(11 -18*n +10*n^2 -6*n^3)): n in [1..40]]; // G. C. Greubel, Apr 21 2022
    
  • Mathematica
    CoefficientList[Series[2*x*(3+2*x+x^2)*(1+x+2*x^2)/((1-x)^5*(1+x)^2), {x,0,40}], x] (* Vincenzo Librandi, May 27 2013 *)
  • SageMath
    [(n/12)*(3*(-1)^n -(11 -18*n +10*n^2 -6*n^3)) for n in (1..40)] # G. C. Greubel, Apr 21 2022

Formula

Explicit formula (Christian Poisson, 1990): a(n) = n*(3*n^3 - 5*n^2 + 9*n - 4)/6 if n is even and a(n) = n*(n - 1)*(3*n^2 - 2*n + 7)/6 if n is odd.
G.f.: 2*x^2*(3+2*x+x^2)*(1+x+2*x^2)/((1-x)^5*(1+x)^2). - Vaclav Kotesovec, Mar 25 2010
From G. C. Greubel, Apr 21 2022: (Start)
a(n) = (1/12)*n*(3*(-1)^n - (11 - 18*n + 10*n^2 - 6*n^3)).
E.g.f.: (x/12)*(-3*exp(-x) + (3 + 30*x + 26*x^2 + 6*x^3)exp(x)). (End)

A201540 Number of ways to place n nonattacking knights on an n X n board.

Original entry on oeis.org

1, 6, 36, 412, 9386, 257318, 8891854, 379978716, 19206532478, 1120204619108, 74113608972922, 5483225594409823, 448414229054798028, 40154319792412218900, 3906519894750904583838
Offset: 1

Views

Author

Vaclav Kotesovec, Dec 02 2011

Keywords

Comments

a(n) = A244081(n,n). - Alois P. Heinz, Jun 19 2014

Crossrefs

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]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, Array[True&, n*3]]];
    a[n_] := T[n][[n + 1]];
    Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 10}] (* Jean-François Alcover, Mar 29 2016, after Alois P. Heinz's code for A244081 *)

Formula

a(n) ~ n^(2n)/n!*exp(-9/2). - Vaclav Kotesovec, Nov 29 2011

Extensions

a(11) from Alois P. Heinz, Jun 19 2014
a(12)-a(13) from Vaclav Kotesovec, Jun 21 2014
a(14) from Vaclav Kotesovec, Aug 26 2016
a(15) from Vaclav Kotesovec, May 26 2021

A172137 Number of ways to place 2 nonattacking zebras on an n X n board.

Original entry on oeis.org

0, 6, 36, 112, 276, 582, 1096, 1896, 3072, 4726, 6972, 9936, 13756, 18582, 24576, 31912, 40776, 51366, 63892, 78576, 95652, 115366, 137976, 163752, 192976, 225942, 262956, 304336, 350412, 401526, 458032, 520296, 588696, 663622, 745476, 834672, 931636, 1036806
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 26 2010

Keywords

Comments

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

References

  • Christian Poisson, Echecs et mathematiques, Rex Multiplex 29/1990, p. 829.

Crossrefs

Programs

  • Magma
    [n eq 1 select 0 else (n^4 -9*n^2 +40*n -48)/2: n in [1..50]]; // G. C. Greubel, Apr 19 2022
    
  • Mathematica
    CoefficientList[Series[2x(3+3*x-4*x^2+8*x^3-4*x^4)/(1-x)^55, {x, 0, 40}], x] (* Vincenzo Librandi, May 26 2013 *)
  • SageMath
    [(n^4 -9*n^2 +40*n -48 +16*bool(n==1))/2 for n in (1..50)] # G. C. Greubel, Apr 19 2022

Formula

a(n) = (n^4 - 9*n^2 + 40*n - 48)/2, n >= 2. (Christian Poisson, 1990)
G.f.: 2*x^2*(3+3*x-4*x^2+8*x^3-4*x^4)/(1-x)^5. - Vaclav Kotesovec, Mar 25 2010
E.g.f.: (1/2)*(16*(3+x) + (-48 + 32*x - 2*x^2 + 6*x^3 + x^4)*exp(x)). - G. C. Greubel, Apr 19 2022

A172529 Number of ways to place 2 nonattacking knights on an n X n toroidal board.

Original entry on oeis.org

0, 2, 18, 88, 200, 486, 980, 1760, 2916, 4550, 6776, 9720, 13520, 18326, 24300, 31616, 40460, 51030, 63536, 78200, 95256, 114950, 137540, 163296, 192500, 225446, 262440, 303800, 349856, 400950, 457436, 519680, 588060, 662966, 744800, 833976, 930920, 1036070
Offset: 1

Views

Author

Vaclav Kotesovec, Feb 06 2010

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[2 x (16 x^7 - 71 x^6 + 121 x^5 - 98 x^4 + 40 x^3 - 9 x^2 - 4 x - 1) / (x - 1)^5, {x, 0, 50}], x] (* Vincenzo Librandi, May 29 2013 *)

Formula

a(n) = n^2*(n+3)*(n-3)/2, n>=5.
G.f.: 2*x^2*(16*x^7-71*x^6+121*x^5-98*x^4+40*x^3-9*x^2-4*x-1)/(x-1)^5. - Vaclav Kotesovec, Mar 25 2010

Extensions

More terms from Vincenzo Librandi, May 29 2013

A172964 Number of ways to place 2 nonattacking knights on an n X n cylindrical board.

Original entry on oeis.org

0, 4, 18, 92, 230, 522, 1022, 1808, 2970, 4610, 6842, 9792, 13598, 18410, 24390, 31712, 40562, 51138, 63650, 78320, 95382, 115082, 137678, 163440, 192650, 225602, 262602, 303968, 350030, 401130, 457622, 519872, 588258, 663170, 745010, 834192, 931142, 1036298, 1150110
Offset: 1

Views

Author

Vaclav Kotesovec, Feb 06 2010

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[2 x (6 x^7 - 30 x^6 + 61 x^5 - 66 x^4 + 45 * x^3 - 21 x^2 + x - 2) / (x - 1)^5, {x, 0, 50}], x] (* Vincenzo Librandi, May 29 2013 *)

Formula

a(n) = n*(n^3 - 9*n + 12)/2, n>=5.
G.f.: 2*x^2*(6*x^7-30*x^6+61*x^5-66*x^4+45*x^3-21*x^2+x-2)/(x-1)^5. - Vaclav Kotesovec, Mar 25 2010

Extensions

More terms from Vincenzo Librandi, May 29 2013
Showing 1-10 of 12 results. Next