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.

A201629 a(n) = n if n is even and otherwise its nearest multiple of 4.

Original entry on oeis.org

0, 0, 2, 4, 4, 4, 6, 8, 8, 8, 10, 12, 12, 12, 14, 16, 16, 16, 18, 20, 20, 20, 22, 24, 24, 24, 26, 28, 28, 28, 30, 32, 32, 32, 34, 36, 36, 36, 38, 40, 40, 40, 42, 44, 44, 44, 46, 48, 48, 48, 50, 52, 52, 52, 54, 56, 56, 56, 58, 60, 60, 60, 62, 64, 64, 64, 66, 68, 68
Offset: 0

Views

Author

Vaclav Kotesovec, Dec 03 2011

Keywords

Comments

For n > 1, the maximal number of nonattacking knights on a 2 x (n-1) chessboard.
Compare this with the binary triangle construction of A240828.
Minimal number of straight segments in a rook circuit of an (n-1) X n board (see example). - Ruediger Jehn, Feb 26 2021

Examples

			G.f. = 2*x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 6*x^6 + 8*x^7 + 8*x^8 + 8*x^9 + ...
From _Ruediger Jehn_, Feb 26 2021: (Start)
a(5) = 4:
   +----+----+----+----+----+
   |  __|____|_   |   _|__  |
   | /  |    | \  |  / |  \ |
   +----+----+----+----+----+
   | \__|__  | |  |  | |  | |
   |    |  \ | \__|__/ |  | |
   +----+----+----+----+----+
   |  __|__/ |  __|__  |  | |
   | /  |    | /  |  \ |  | |
   +----+----+----+----+----+
   | \  |    | |  |  | |  | |
   |  \_|____|_/  |  \_|__/ |
   +----+----+----+----+----+
There are at least 4 squares on the 4 X 5 board with straight lines (here in squares a_12, a_25, a_35 and a_42).  (End)
		

Crossrefs

Programs

  • Haskell
    a201629 = (* 2) . a004524 . (+ 1) -- Reinhard Zumkeller, Aug 05 2014
    
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(2*x^2/((1-x)^2*(1+x^2)))); // G. C. Greubel, Aug 13 2018
  • Maple
    seq(n-sin(Pi*n/2), n=0..30); # Robert Israel, Jul 14 2015
  • Mathematica
    Table[2*(Floor[(Floor[(n + 1)/2] + 1)/2] + Floor[(Floor[n/2] + 1)/2]), {n, 1, 100}]
    Table[If[EvenQ[n], n, 4*Round[n/4]], {n, 0, 68}] (* Alonso del Arte, Jan 27 2012 *)
    CoefficientList[Series[2 x^2/((-1 + x)^2 (1 + x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 06 2014 *)
    a[ n_] := n - KroneckerSymbol[ -4, n]; (* Michael Somos, Jul 18 2015 *)
  • PARI
    a(n)=n\4*4+[0, 0, 2, 4][n%4+1] \\ Charles R Greathouse IV, Jan 27 2012
    
  • PARI
    {a(n) = n - kronecker( -4, n)}; /* Michael Somos, Jul 18 2015 */
    

Formula

a(n) = n - sin(n*Pi/2).
G.f.: 2*x^2/((1-x)^2*(1+x^2)).
a(n) = 2*A004524(n+1). - R. J. Mathar, Feb 02 2012
a(n) = n+(1-(-1)^n)*(-1)^((n+1)/2)/2. - Bruno Berselli, Aug 06 2014
E.g.f.: x*exp(x) - sin(x). - G. C. Greubel, Aug 13 2018

Extensions

Formula corrected by Robert Israel, Jul 14 2015

A189889 Maximum number of nonattacking kings on an n X n toroidal board.

Original entry on oeis.org

1, 1, 1, 4, 5, 9, 10, 16, 18, 25, 27, 36, 39, 49, 52, 64, 68, 81, 85, 100, 105, 121, 126, 144, 150, 169, 175, 196, 203, 225, 232, 256, 264, 289, 297, 324, 333, 361, 370, 400, 410, 441, 451, 484, 495, 529, 540, 576, 588, 625
Offset: 1

Views

Author

Vaclav Kotesovec, Apr 30 2011

Keywords

Comments

a(n) is the independence number of the Cayley graph on the group Z_n X Z_n with generators (+-e_1, +-e_2)<>(0,0) where e_i is in {0,1} for i=1,2. - Miquel A. Fiol, Aug 07 2024
For n>=4 a(n) is the maximum number of edges of an n-cycle graph with chords not containing any triangle with some edges of the cycle. - Miquel A. Fiol, Sep 20 2024

References

  • John Watkins, Across the Board: The Mathematics of Chessboard Problems (2004), Theorem 11.1, p.194.

Crossrefs

Programs

  • Magma
    [1] cat [Floor(n*Floor(n/2)/2): n in [2..50]]; // G. C. Greubel, Jan 13 2018
  • Maple
    A189889:=n->`if`(n=1,1,floor(n*floor(n/2)/2)); seq(A189889(k), k=1..100); # Wesley Ivan Hurt, Nov 07 2013
  • Mathematica
    Table[If[n==1,1,Floor[(n*Floor[n/2])/2]],{n,1,50}]
    CoefficientList[Series[(- x^7 + x^6 + x^5 + 3 * x^3 - x^2 + 1) / (-x^7 + x^6 + x^5 - x^4 + x^3 - x^2 - x + 1), {x, 0, 50}], x] (* Vincenzo Librandi, Jun 02 2013 *)
    Join[{1},LinearRecurrence[{1,1,-1,1,-1,-1,1},{1,1,4,5,9,10,16},50]] (* Harvey P. Dale, Aug 07 2013 *)
  • PARI
    Vec(x*(-x^7 + x^6 + x^5 + 3*x^3 - x^2 + 1) / (-x^7 + x^6 + x^5 - x^4 + x^3 - x^2 - x + 1) + O(x^51)) \\ Indranil Ghosh, Mar 09 2017
    
  • PARI
    a(n) = if(n==1, 1, floor((n*floor(n/2))/2)); \\ Indranil Ghosh, Mar 09 2017
    
  • Python
    def A189889(n): return 1 if n==1 else (n*(n/2))/2 # Indranil Ghosh, Mar 09 2017
    

Formula

a(n) = floor((n*floor(n/2))/2), n > 1 (Watkins and Ricci, 2004).
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) - a(n-5) - a(n-6) + a(n-7).
G.f.: x*(-x^7 +x^6 +x^5 +3*x^3 -x^2 +1) / (-x^7 +x^6 +x^5 -x^4+ x^3 -x^2 -x +1).

A279402 Domination number for queen graph on an n X n toroidal board.

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 7, 7, 5, 8, 9, 8, 10, 10, 7, 11
Offset: 1

Views

Author

Andrey Zabolotskiy, Dec 11 2016

Keywords

Comments

That is, the minimal number of queens needed to cover an n X n toroidal chessboard so that every square either has a queen on it, or is under attack by a queen, or both.
Row lengths of the triangle A279403.
All dominating sets are translation-invariant on the torus.
a(4*n) <= 2*n.
a(n) <= A075458(n).

Examples

			The minimal dominating set for the queens' graph on a 15 X 15 toroidal board is:
...............
..........Q....
...............
...............
.Q.............
...............
...............
.......Q.......
...............
...............
.............Q.
...............
...............
....Q..........
...............
Hence a(15) = 5.
		

References

  • John J. Watkins, Across the Board: The Mathematics of Chessboard Problem, Princeton University Press, 2004, pp. 139-140.

Crossrefs

Formula

a(3*n) = n if n == 1, 5, 7, 11 (mod 12);
a(3*n) = n+1 if n == 2, 10 (mod 12);
a(3*n) = n+2 otherwise.
I.e., a(3*n) = 2*n - A085801(n).

Extensions

a(16)-a(22) from Andy Huchala, Mar 04 2024

A279404 Independent domination number for queens' graph on an n X n toroidal board.

Original entry on oeis.org

1, 1, 1, 2, 5, 4, 5, 4, 5, 5, 5, 6, 7, 7, 5, 8, 9, 10
Offset: 1

Views

Author

Andrey Zabolotskiy, Dec 11 2016

Keywords

Comments

That is, the minimal number of queens needed to cover an n X n toroidal chessboard so that every square either has a queen on it or is under attack by a queen, but not both.
A279402(n) <= a(n) <= A085801(n).

Crossrefs

Formula

a(3*n) = n if n = 1, 5, 7, 11 (mod 12).

Extensions

a(17)-a(18) from Andy Huchala, Mar 09 2024

A190394 Maximum number of nonattacking nightriders on an n X n board.

Original entry on oeis.org

1, 4, 5, 8, 10, 16, 17, 20, 21, 24, 26, 32, 33, 36, 39, 42, 45, 48, 51, 54, 58, 64, 65, 66, 68, 72, 75, 80, 81, 84, 87, 90, 93
Offset: 1

Views

Author

Vaclav Kotesovec, May 10 2011

Keywords

Comments

A nightrider is a fairy chess piece that can move any distance in a direction specified by a knight move.
Maximum number of nonattacking nightriders on an n X n toroidal board is n.

Examples

			From _Rob Pratt_, Jul 24 2015: (Start)
a(20) = 54:
  XX--XXXX---X------XX
  XX---------X--XX--XX
  --------------------
  ---X----------------
  X-----------------X-
  X-----------------X-
  X-------------------
  X---------X---------
  ------------------XX
  ------------X-------
  -------X------------
  XX------------------
  ---------X---------X
  -------------------X
  -X-----------------X
  -X-----------------X
  ----------------X---
  --------------------
  XX--XX--X---------XX
  XX------X---XXXX--XX
(End)
		

Crossrefs

Formula

2n <= a(n) <= 3n-2, for n > 3.
a(n) >= 24*floor((n+4)/10)-8, for n >= 6. - Vaclav Kotesovec, Apr 01 2012

Extensions

Terms a(11)-a(16) from Vaclav Kotesovec, May 13 2011
Terms a(17)-a(19) from Vaclav Kotesovec, Apr 01 2012
a(20) from Rob Pratt, Jul 24 2015
a(21)-a(32) from Paul Tabatabai, Nov 06 2018
a(33) from Andy Huchala, Mar 30 2024

A279409 Triangle read by rows: T(n,m) (n>=m>=1) = maximum number of nonattacking kings on an n X m toroidal board.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 4, 5, 3, 3, 3, 6, 6, 9, 3, 3, 3, 6, 7, 9, 10, 4, 4, 4, 8, 8, 12, 12, 16, 4, 4, 4, 8, 9, 12, 13, 16, 18, 5, 5, 5, 10, 10, 15, 15, 20, 20, 25, 5, 5, 5, 10, 11, 15, 16, 20, 22, 25, 27, 6, 6, 6, 12, 12, 18, 18, 24, 24, 30, 30, 36
Offset: 1

Views

Author

Andrey Zabolotskiy, Dec 16 2016

Keywords

Comments

Independence number of the kings' graph on toroidal n X m chessboard.
Right border T(n,n) is A189889.
For the usual non-toroidal case, the formula is ceiling(m/2)*ceiling(n/2).

Examples

			Triangle starts:
  1;
  1, 1;
  1, 1, 1;
  2, 2, 2, 4;
  2, 2, 2, 4, 5;
  3, 3, 3, 6, 6, 9;
  3, 3, 3, 6, 7, 9, 10;
  ...
		

References

  • John J. Watkins, Across the Board: The Mathematics of Chessboard Problem, Princeton University Press, 2004, pages 194-196.

Crossrefs

Programs

  • Mathematica
    T[1, 1] = 1; T[n_, m_]:= If[m==1, Floor[n/2], Floor[Min[m Floor[n/2], n Floor[m/2]]/2]]; Flatten[Table[T[n,m], {n, 1, 12},{m, 1,n}]] (* Indranil Ghosh, Mar 09 2017 *)
  • PARI
    tabl(nn) = {for(n=1, 12, for(m=1, n, print1(if(m==1,if(n==1, 1, floor(n/2)), floor(min(m*floor(n/2), n*floor(m/2))/2)),", ");); print();); };
    tabl(12); \\ Indranil Ghosh, Mar 09 2017
    
  • Python
    def T(n,m):
        if m==1:
            if n==1: return 1
            return n//2
        return min(m*(n//2), n*(m//2))//2
    i=1
    for n in range(1,126):
        for m in range(1, n+1):
            print(i, T(n,m))
            i+=1 # Indranil Ghosh, Mar 09 2017

Formula

T(n,m) = floor(min(m*floor(n/2), n*floor(m/2))/2) for m>1;
T(n,1) = floor(n/2) for n>1.

A133143 Maximal number of mutually nonattacking Super Queens on an n X n board. (A Super Queen is a queen with both queen and knight powers.)

Original entry on oeis.org

1, 1, 1, 2, 4, 4, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Offset: 1

Views

Author

Rachit Agrawal (rachit_agrawal(AT)daiict.ac.in), Dec 16 2007

Keywords

Comments

From Vaclav Kotesovec, Mar 14 2011: (Start)
For n >= 10, a(n)=n, see A051223.
For same problem on a toroidal chessboard the results for n > 10 are the same as for queens (A085801). (End)

Examples

			a(4) = 2:
|X|0|0|0|
|0|0|0|X|
|0|0|0|0|
|0|0|0|0|
where X denotes the place of a Super Queen.
		

Programs

  • Java
    // See Java code text file in the links section.

A178986 Number of ways to place n nonattacking amazons (superqueens) on an n X n toroidal board.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 1092, 0, 0, 0, 16932, 0, 24776, 0, 0, 0, 1881492, 0
Offset: 1

Views

Author

Vaclav Kotesovec, Jan 03 2011

Keywords

Comments

An amazon (superqueen) moves like a queen and a knight.

Crossrefs

Showing 1-8 of 8 results.