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.

A319288 a(n) is the smallest k such that A319284(n, k) >= A319284(n, j) for all 0 <= j <= n.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15
Offset: 0

Views

Author

Peter Luschny, Sep 16 2018

Keywords

Comments

Intuitively this is the level in the backtrack tree of the n queens problem where the algorithm spends more time than on any other level.
The constraint 'is the smallest' in the name can be dropped if the profile of the backtrack tree of the n queens problem is unimodal (for n>1).
The corresponding maxima are: 1, 1, 2, 3, 6, 14, 46, 164, 568, 2292, 9632, 44148, 222720, 1151778, 6471872, 39290462, 260303408, 1812613348, 13308584992, 102670917500.

Crossrefs

A000170 Number of ways of placing n nonattacking queens on an n X n board.

Original entry on oeis.org

1, 1, 0, 0, 2, 10, 4, 40, 92, 352, 724, 2680, 14200, 73712, 365596, 2279184, 14772512, 95815104, 666090624, 4968057848, 39029188884, 314666222712, 2691008701644, 24233937684440, 227514171973736, 2207893435808352, 22317699616364044, 234907967154122528
Offset: 0

Views

Author

Keywords

Comments

For n > 3, a(n) is the number of maximum independent vertex sets in the n X n queen graph. - Eric W. Weisstein, Jun 20 2017
Number of nodes on level n of the backtrack tree for the n queens problem (a(n) = A319284(n, n)). - Peter Luschny, Sep 18 2018
Number of permutations of [1...n] such that |p(j)-p(i)| != j-i for iXiangyu Chen, Dec 24 2020
M. Simkin shows that the number of ways to place n mutually nonattacking queens on an n X n chessboard is ((1 +/- o(1))*n*exp(-c))^n, where c = 1.942 +/- 0.003. These are approximately (0.143*n)^n configurations. - Peter Luschny, Oct 07 2021

Examples

			a(2) = a(3) = 0, since on 2 X 2 and 3 X 3 chessboards there are no solutions.
.
a(4) = 2:
  +---------+ +---------+
  | . . Q . | | . Q . . |
  | Q . . . | | . . . Q |
  | . . . Q | | Q . . . |
  | . Q . . | | . . Q . |
  +---------+ +---------+
a(5) = 10:
  +-----------+ +-----------+ +-----------+ +-----------+ +-----------+
  | . . . Q . | | . . Q . . | | . . . . Q | | . . . Q . | | . . . . Q |
  | . Q . . . | | . . . . Q | | . . Q . . | | Q . . . . | | . Q . . . |
  | . . . . Q | | . Q . . . | | Q . . . . | | . . Q . . | | . . . Q . |
  | . . Q . . | | . . . Q . | | . . . Q . | | . . . . Q | | Q . . . . |
  | Q . . . . | | Q . . . . | | . Q . . . | | . Q . . . | | . . Q . . |
  +-----------+ +-----------+ +-----------+ +-----------+ +-----------+
  +-----------+ +-----------+ +-----------+ +-----------+ +-----------+
  | Q . . . . | | . Q . . . | | Q . . . . | | . . Q . . | | . Q . . . |
  | . . . Q . | | . . . . Q | | . . Q . . | | Q . . . . | | . . . Q . |
  | . Q . . . | | . . Q . . | | . . . . Q | | . . . Q . | | Q . . . . |
  | . . . . Q | | Q . . . . | | . Q . . . | | . Q . . . | | . . Q . . |
  | . . Q . . | | . . . Q . | | . . . Q . | | . . . . Q | | . . . . Q |
  +-----------+ +-----------+ +-----------+ +-----------+ +-----------+
a(6) = 4:
  +-------------+ +-------------+ +-------------+ +-------------+
  | . . . . Q . | | . . . Q . . | | . . Q . . . | | . Q . . . . |
  | . . Q . . . | | Q . . . . . | | . . . . . Q | | . . . Q . . |
  | Q . . . . . | | . . . . Q . | | . Q . . . . | | . . . . . Q |
  | . . . . . Q | | . Q . . . . | | . . . . Q . | | Q . . . . . |
  | . . . Q . . | | . . . . . Q | | Q . . . . . | | . . Q . . . |
  | . Q . . . . | | . . Q . . . | | . . . Q . . | | . . . . Q . |
  +-------------+ +-------------+ +-------------+ +-------------+
- _Hugo Pfoertner_, Mar 17 2019
		

References

  • M. Gardner, The Unexpected Hanging, pp. 190-2, Simon & Shuster NY 1969
  • Jieh Hsiang, Yuh-Pyng Shieh and Yao-Chiang Chen, The cyclic complete mappings counting problems, in Problems and Problem Sets for ATP, volume 02-10 of DIKU technical reports, G. Sutcliffe, J. Pelletier and C. Suttner, eds., 2002.
  • D. E. Knuth, The Art of Computer Programming, Volume 4, Pre-fascicle 5B, Introduction to Backtracking, 7.2.2. Backtrack programming. 2018.
  • M. Kraitchik, The Problem of The Queens, Mathematical Recreations, 2nd ed., New York, Dover, 1953, pp. 247-256.
  • Massimo Nocentini, "An algebraic and combinatorial study of some infinite sequences of numbers supported by symbolic and logic computation", PhD Thesis, University of Florence, 2019. See Ex. 67.
  • W. W. Rouse Ball and H. S. M. Coxeter, Mathematical Recreations and Essays, 13th ed., New York, Dover, 1987, pp. 166-172 (The Eight Queens Problem).
  • M. A. Sainte-Laguë, Les Réseaux (ou Graphes), Mémorial des Sciences Mathématiques, Fasc. 18, Gauthier-Villars, Paris, 1926, p. 47.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. J. Walker, An enumerative technique for a class of combinatorial problems, pp. 91-94 of Proc. Sympos. Applied Math., vol. 10, Amer. Math. Soc., 1960.
  • M. B. Wells, Elements of Combinatorial Computing. Pergamon, Oxford, 1971, p. 238.

Crossrefs

Cf. A036464 (2Q), A047659 (3Q), A061994 (4Q), A108792 (5Q), A176186 (6Q).
Cf. A099152, A006717, A051906, A319284 (backtrack trees).
Main diagonal of A348129.

Formula

Strong conjecture: there is a constant c around 2.54 such that a(n) is asymptotic to n!/c^n; weak conjecture: lim_{n -> infinity} (1/n) * log(n!/a(n)) = constant = 0.90.... - Benoit Cloitre, Nov 10 2002
Lim_{n->infinity} a(n)^(1/n)/n = exp(-A359441) = 0.1431301... [Simkin 2021]. - Vaclav Kotesovec, Jan 01 2023
a(n) = 8 * A260320(n) + 4 * A260319(n) + 2 * A260318(n) for n >= 2 (see Kraitchik reference). - Jason Bard, Aug 12 2025

Extensions

Terms for n=21-23 computed by Sylvain PION (Sylvain.Pion(AT)sophia.inria.fr) and Joel-Yann FOURRE (Joel-Yann.Fourre(AT)ens.fr).
a(24) from Kenji KISE (kis(AT)is.uec.ac.jp), Sep 01 2004
a(25) from Objectweb ProActive INRIA Team (proactive(AT)objectweb.org), Jun 11 2005 [Communicated by Alexandre Di Costanzo (Alexandre.Di_Costanzo(AT)sophia.inria.fr)]. This calculation took about 53 years of CPU time.
a(25) has been confirmed by the NTU 25Queen Project at National Taiwan University and Ming Chuan University, led by Yuh-Pyng (Arping) Shieh, Jul 26 2005. This computation took 26613 days CPU time.
The NQueens-at-Home web site gives a different value for a(24), 226732487925864. Thanks to Goran Fagerstrom for pointing this out. I do not know which value is correct. I have therefore created a new entry, A140393, which gives the NQueens-at-home version of the sequence. - N. J. A. Sloane, Jun 18 2008
It now appears that this sequence (A000170) is correct and A140393 is wrong. - N. J. A. Sloane, Nov 08 2008
Added a(26) as calculated by Queens(AT)TUD [http://queens.inf.tu-dresden.de/]. - Thomas B. Preußer, Jul 11 2009
Added a(27) as calculated by the Q27 Project [https://github.com/preusser/q27]. - Thomas B. Preußer, Sep 23 2016
a(0) = 1 prepended by Joerg Arndt, Sep 16 2018

A250000 Peaceable coexisting armies of queens: the maximum number m such that m white queens and m black queens can coexist on an n X n chessboard without attacking each other.

Original entry on oeis.org

0, 0, 1, 2, 4, 5, 7, 9, 12, 14, 17, 21, 24, 28, 32
Offset: 1

Views

Author

Don Knuth, Aug 01 2014

Keywords

Comments

Comments from N. J. A. Sloane, May 22 2019: (Start)
The earliest reference known for this problem is Ainley (1977) - see reference and excerpts below. He found constructions for n <= 30 which have never been surpassed (except for n=27 - see Knuth's comment below), and he gave a general construction (the 4-pentagon or "4-blob" construction) which achieves a lower bound of 7*n^2/48.
Most of the results described in the examples and comments below (with the exception of the optimality proofs and the enumeration of different solutions) are rediscoveries of Ainley's work.
Ainley's values for n = 1 through 30 are 0, 0, 1, 2, 4, 5, 7, 9, 12, 14, 17, 21, 24, 28, 32, 37, 42, 47, 52, 58, 64, 70, 77, 84, 91, 98, 105, 114, 122, 131. (End)
Sequence A260680 counts the inequivalent configurations or "solutions" corresponding to the maximum number a(n) of queens of each color. Two solutions are regarded as equivalent if one can be obtained from the other by rotations, reflections, or interchanging the colors (a group of order 16).
For the number of inequivalent solutions see A260680.
From Bob Selcoe, Feb 09 2015: (Start)
For n = 4m, a generalized quasi-symmetric pattern of queen arrangements exists showing that a(n) >= ceiling((n+4)(n-2)/8) + floor((n-4)^2/64) == (m+1)(2m-1) + A002620(m-1).
For n = 4m-1, a slightly different pattern exists showing that a(n) >= m(2m-1) + A002620(m).
Both patterns are difficult to describe easily: as m increases, each depends on slight variations to standard arrangements of opposing queens in "blocks" on opposite corners of the chessboard, plus an additional block arrangement which is "forced" by virtue of the corner blocks. See below for examples of boards for n = {12,16,20,24} that show the pattern for n = 4m.
For all n >= 16, a(n) > ceiling(9n^2/64), which is the best asymptotic lower bound presently known.
It is likely that similar "block" patterns exist for n = {4m+1, 4m+2}.
(End)
Comments from Benoit Jubin, Feb 24 2015: (Start)
By modifying the Pratt-Selcoe configuration, I improved the best known lower bound from a(n) > (9/4)*(n/4)^2 to a(n) > (7/3)*(n/4)^2.
I have been sloppy with side effects, but to be on the safe side, let's say a(n) > (7/3)*(floor(n/4))^2 - (3+8*sqrt(2)/3)*ceiling(n/4), where the coefficient 3+8*sqrt(2)/3 is a perimeter that you can compute from the following description.
The configuration in the limit n = infinity is as follows: denoting by x,y in [0,1] the coordinates on the chessboard, the queens of one color are in the two regions x < 1/4, y < 1/2, x < y < x+1/3 and 1/2 < x < 3/4, y < x-1/3, y < 1-x and the queens of the other color are obtained by central symmetry.
As you can guess, I obtained these coefficients by equalizing the lengths of the "opposite" boundaries of the armies (this already improves (by 1) on the "Board 4" example of the webpage).
Using an easy upper bound, one has asymptotically
(2+1/3)*(n/4)^2 < a(n) < 4*(n/4)^2.
Nov 20 2018: Benoit Jubin explained how his upper bound was obtained, as follows:
Let's replace the queens with "amicable rooks". Say white rooks together control a columns and b rows, and the number of white (or black) rooks is N. Then N <= ab (the white constraint) and N <= (n-a)(n-b) (the black constraint). Therefore the largest value than N can take is upper-bounded by setting ab = (n-a)(n-b), so a = b = n/2 and N <= n^2/4. (End)
From Daniel Forgues, Feb 27 2015: (Start)
Observation: Suppose n >= 2 (omitting the 1 X 1 board):
for n = 2k, k >= 1, the values of a(n) are
{0, 2, 5, 9, 14, 21, ...}
for n = 2k+1, k >= 1, the values are
{1, 4, 7, 12, 17, 24, ...}
and then a(2k+1) - a(2k), k >= 1, yields
{1, 2, 2, 3, 3, 3, ...}.
(End)
From Peter Karpov, Apr 03 2016: (Start)
It appears that the maximal asymptotic density of one color for a configuration consisting of two pentagonal regions and their antipodal counterparts (with respect to the center) is 7/48.
Empirical observation: except for two small cases (n = 5, 9), the known values are given by a(n) = floor(7*n^2/48) (see A286283).
(End)
On a board with a maximal set of coexisting armies of queens, is every cell not occupied by a queen attacked by at least one queen of either color? - David A. Corneth, Oct 16 2018
This was problem C1 in Stephen Ainley's 1977 book cited below. His solution on page 31 exhibited precisely the construction rediscovered by Jubin in 2015. On pages 31 and 32 he listed his best results for n up to 30; these agree with a[n] for n up to 13, and with floor(7*n^2/48) for n from 14 to 30, EXCEPT that his best for n=27 was 105 (not 106). He also remarked that one could squeeze in another queen of one color when n is 4, 6, 8, 10, 11, 13, 14, 15, 19, 22, 26, 29. [When n=27, his best was 105 white queens and 107 black queens.] - Don Knuth, Apr 27 2019
The basic configuration of the "cracked block" solution for the n=20, 58-queen arrangement (see May 23 2017 example) is generalizable for all n = 16k+4, k >= 1. While the pattern is difficult to describe briefly enough for this site (each block can be broken down into component sections, each of these described in relation to n), all such n X n boards include the "corner" blocks extending n/4 squares east-to-west and n/2 squares north-to-south, while the "center" blocks extend n/4 squares east-to-west, starting n/4 + 1 squares from the nearest corner. The center white piece and "cracks" (as shown in the n=20 example) appear at the same relative positions in every board. - Bob Selcoe, May 16 2019
It is possible to construct a 15 X 15 board with 32 queens of one color and 34 of another (improving on Ainley's observation of 32 and 33 - see Knuth's Apr 27 2019 comment). Call the larger armies "aggressors". What might be the sequence of largest aggressors, for all optimal A250000(n)? Note that 34 may not be the largest possible aggressor for n=15. - Bob Selcoe, May 29 2019

Examples

			Some examples, in increasing order of size of board.
n=3: There is a unique solution (up to obvious symmetries):
+-------+
| W . . |
| . . . |
| . B . |
+-------+
n=4: There are ten inequivalent solutions, up to obvious symmetries (_Rob Pratt_, Jul 29 2015, with two more discovered by _Benoit Jubin_, Mar 17 2019; total of 10 confirmed by _Rob Pratt_, Mar 18 2019):
----------------------------------------------------------
|..B.||.B..||.B..||....||.BB.||..B.||...W||..B.|..B.|..W.|
|....||.B..||...B||.B.B||....||.B..||.B..||...B|B...|B...|
|...B||....||....||....||....||...W||..B.||.W..|...W|...B|
|WW..||W.W.||W.W.||W.W.||W..W||W...||W...||W...|.W..|.W..|
----------------------------------------------------------
n=5: One of the three solutions for n=5 puts one set of four queens in the corners and the other set in the squares a knight's move away, as follows:
+-----------+
| W . . . W |
| . . B . . |
| . B . B . |
| . . B . . |
| W . . . W |
+-----------+
There are two other solutions (up to symmetry) for n=5 (found by _Rob Pratt_, circa Sep 2014):
+-----------+
| . . B . B |
| W . . . . |
| . . B . B |
| W . . . . |
| . W . W . |
+-----------+
.
+-----------+
| . W . W . |
| . . W . . |
| B . . . B |
| . . W . . |
| B . . . B |
+-----------+
n=6: A solution for n=6:
+-------------+
| . W W . . . |
| . . W . . W |
| . . . . . W |
| . . . . . . |
| B . . . B . |
| B . . B B . |
+-------------+
n=8: a(8) = 9:
+-----------------+
| . . W W . . . . |
| . . W W . . . W |
| . . W . . . W W |
| . . . . . . W W |
| . B . . . . . . |
| B B . . . . . . |
| B B . . . B . . |
| B . . . B B . . | - _Rob Pratt_, Jul 29 2015
+-----------------+
n=9: A solution from _Bob Selcoe_, Feb 07 2015:
+-------------------+
| . B . B . B . B . |
| . . B . . . B . . |
| W . . . W . . . W |
| . . B . . . B . . |
| W . . . W . . . W |
| . . B . . . B . . |
| W . . . W . . . W |
| . . B . . . B . . |
| W . . . W . . . W |
+-------------------+
A solution for n=12 (from Prestwich/Beck paper):
+-------------------------+
| . . . B B B . . . . . B |
| . . . B B B . . . . B . |
| . . . B B B . . . B . B |
| . . . . B . . . . . B B |
| . . . . . . . . . B B B |
| . . . . . . . . . B B . |
| . . W . . . W . . . . . |
| . W W . . . . . . . . . |
| W W W . . . . . W . . . |
| W W . . . . . W W . . . |
| W . W . . . W W W . . . |
| . W . . . . W W W . . . |
+-------------------------+
A solution for n=13 (from Prestwich/Beck paper):
+---------------------------+
| B . . . B . B . . . B . B |
| . . W . . . . . W . . . . |
| . W . W . W . W . W . W . |
| . . W . . . . . W . . . . |
| B . . . B . B . . . B . B |
| . . W . . . . . W . . . . |
| B . . . B . B . . . B . B |
| . . W . . . . . W . . . . |
| . W . W . W . W . W . W . |
| . . W . . . . . W . . . . |
| B . . . B . B . . . B . B |
| . . W . . . . . W . . . . |
| B . . . B . B . . . B . B |
+---------------------------+
From _Bob Selcoe_, Feb 07 2015: (Start)
An alternative solution for n=13:
+---------------------------+
| . B . B . B . B . B . B . |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
| . . B . . . B . . . B . . |
| W . . . W . . . W . . . W |
+---------------------------+
n=15, a fully symmetrical optimal configuration from _Paul Tabatabai_, Oct 16 2018:
+-------------------------------+
| B . B . B . . . . . B . B . B |
| . . . . . . W W W . . . . . . |
| B . B . B . . . . . B . B . B |
| . . . . . . W . W . . . . . . |
| B . B . . . . . . . . . B . B |
| . . . . . . W . W . . . . . . |
| . W . W . W . W . W . W . W . |
| . W . . . . W . W . . . . W . |
| . W . W . W . W . W . W . W . |
| . . . . . . W . W . . . . . . |
| B . B . . . . . . . . . B . B |
| . . . . . . W . W . . . . . . |
| B . B . B . . . . . B . B . B |
| . . . . . . W W W . . . . . . |
| B . B . B . . . . . B . B . B |
+-------------------------------+
n=17: A 42-queen arrangement (the best presently known) for n=17, from _Rob Pratt_, Feb 07 2014:
+-----------------------------------+
| . . . . W W W W W . . . . . . . . |
| . . . . W W W W W . . . . . . . . |
| . . . . W W W W W . . . . . . . W |
| . . . . W W W W . . . . . . . W W |
| . . . . W W W . . . . . . . W W W |
| . . . . . W . . . . . . . W W W W |
| . . . . . . . . . . . . . W W W W |
| . . . . . . . . . . . . . W W W . |
| . . . . . . . . . . . . . W W . . |
| . . B B . . . . . . . . . . . . . |
| . B B B . . . . . . . . . . . . . |
| B B B B . . . . . . . . . . . . . |
| B B B B . . . . . . . B . . . . . |
| B B B B . . . . . . B B B . . . . |
| B B B B . . . . . B B B B . . . . |
| B B B . . . . . . B B B B . . . . |
| B B . . . . . . . B B B B . . . . |
+-----------------------------------+
From _Bob Selcoe_, Feb 09 2015: (Start)
Two alternative 42-queen arrangements for n=17 (inspired by _Rob Pratt_). Other arrangements exist.
Alternative 1:
+-----------------------------------+
| . . . . . W W W W W . . . . . . . |
| . . . . . W W W W W . . . . . . . |
| . . . . . W W W W W . . . . . . W |
| . . . . . W W W W . . . . . . W W |
| . . . . . W W W . . . . . . W W W |
| . . . . . . W . . . . . . W W W W |
| . . . . . . . . . . . . . W W W W |
| . . . . . . . . . . . . . W W W . |
| . . . . . . . . . . . . . W W . . |
| . . . B B . . . . . . . . . . . . |
| . . B B B . . . . . . . . . . . . |
| . B B B B . . . . . . . . . . . . |
| B B B B B . . . . . . B B . . . . |
| B B B B B . . . . . B B B . . . . |
| B B B B . . . . . . B B B . . . . |
| B B B . . . . . . . B B B . . . . |
| B B . . . . . . . . B B B . . . . |
+-----------------------------------+
Alternative 2:
+-----------------------------------+
| . . . . W W W W . . . . . . . . W |
| . . . . W W W W . . . . . . . W W |
| . . . . W W W W . . . . . . W W W |
| . . . . W W W W . . . . . W W W W |
| . . . . . W W . . . . . . W W W W |
| . . . . . . . . . . . . . W W W W |
| . . . . . . . . . . . . . W W W . |
| . . . . . . . . . . . . . W W . . |
| . . . . . . . . . . . . . W . . . |
| . . B B . . . . . . . . . . . . . |
| . B B B . . . . . . . . . . . . . |
| B B B B . . . . . . . B . . . . . |
| B B B B . . . . . . B B B . . . . |
| B B B . . . . . . B B B B . . . . |
| B B . . . . . . B B B B B . . . . |
| B . . . . . . . B B B B B . . . . |
| . . . . . . . . B B B B B . . . . |
+-----------------------------------+
Example of an alternative n=20, 58-queen arrangement with "cracked" blocks from _Bob Selcoe_, May 23 2017:
+-----------------------------------------+
| . . . . . W W W W W . . . . . . . . W . |
| . . . . . W W W W W . . . . . . . W . W |
| . . . . . W W W W W . . . . . . W . W W |
| . . . . . W W W W W . . . . . W . W W W |
| . . . . . W W W W . . . . . . . W W W W |
| . . . . . W W W . . . . . . . W W W W W |
| . . . . . . W . . . . . . . . W W W W . |
| . . . . . . . . . . . . . . . W W W . . |
| . . . . . . . . . . . . . . . W W . . . |
| . . . . . . . . . W . . . . . W . . . . |
| . . . B B . . . . . . . . . . . . . . . |
| . . B B B . . . . . . . . . . . . . . . |
| . B B B B . . . . . . . . . . . . . . . |
| B B B B B . . . . . . . B . . . . . . . |
| B B B B . . . . . . . B B B . . . . . . |
| B B B . B . . . . . B B B B B . . . . . |
| B B . B . . . . . . B B B B B . . . . . |
| B . B . . . . . . . B B B B B . . . . . |
| . B . . . . . . . . B B B B B . . . . . |
| B . . . . . . . . . B B B B B . . . . . |
+-----------------------------------------+
Pattern for n = 4m; four chessboards total.
Board 1: n=12, a(12)=21:
+-------------------------+
| . . . W W W . . . . . . |
| . . . W W W . . . . . W |
| . . . W W W . . . . W W |
| . . . . W . . . . W W W |
| . . . . . . . . . W W W |
| . . . . . . . . . W W . |
| . . B . . . . . . . . . |
| . B B . . . . . . . . . |
| B B B . . . . . B . . . |
| B B B . . . . B B . . . |
| B B . . . . B B B . . . |
| B . . . . . B B B . . . |
+-------------------------+
Board 2: n=16, 37-queen arrangement:
+---------------------------------+
| . . . . W W W W . . . . . . . . |
| . . . . W W W W . . . . . . . W |
| . . . . W W W W . . . . . . W W |
| . . . . W W W W . . . . . W W W |
| . . . . . W W . . . . . W W W W |
| . . . . . . . . . . . . W W W W |
| . . . . . . . . . . . . W W W . |
| . . . . . . . . . . . . W W . . |
| . . . B . . . . . . . . . . . . |
| . . B B . . . . . . . . . . . . |
| . B B B . . . . . . . . . . . . |
| B B B B . . . . . . B B . . . . |
| B B B B . . . . . B B B . . . . |
| B B B . . . . . B B B B . . . . |
| B B . . . . . . B B B B . . . . |
| B . . . . . . . B B B B . . . . |
+---------------------------------+
Board 3: n=20, 58-queen arrangement:
+-----------------------------------------+
| . . . . . W W W W W . . . . . . . . . . |
| . . . . . W W W W W . . . . . . . . . W |
| . . . . . W W W W W . . . . . . . . W W |
| . . . . . W W W W W . . . . . . . W W W |
| . . . . . W W W W W . . . . . . W W W W |
| . . . . . . W W W . . . . . . W W W W W |
| . . . . . . . W . . . . . . . W W W W W |
| . . . . . . . . . . . . . . . W W W W . |
| . . . . . . . . . . . . . . . W W W . . |
| . . . . . . . . . . . . . . . W W . . . |
| . . . . B . . . . . . . . . . . . . . . |
| . . . B B . . . . . . . . . . . . . . . |
| . . B B B . . . . . . . . . . . . . . . |
| . B B B B . . . . . . . . B . . . . . . |
| B B B B B . . . . . . . B B B . . . . . |
| B B B B B . . . . . . B B B B . . . . . |
| B B B B . . . . . . B B B B B . . . . . |
| B B B . . . . . . . B B B B B . . . . . |
| B B . . . . . . . . B B B B B . . . . . |
| B . . . . . . . . . B B B B B . . . . . |
+-----------------------------------------+
Board 4: n=24, 83-queen arrangement:
+-------------------------------------------------+
| . . . . . . W W W W W W . . . . . . . . . . . . |
| . . . . . . W W W W W W . . . . . . . . . . . W |
| . . . . . . W W W W W W . . . . . . . . . . W W |
| . . . . . . W W W W W W . . . . . . . . . W W W |
| . . . . . . W W W W W W . . . . . . . . W W W W |
| . . . . . . W W W W W W . . . . . . . W W W W W |
| . . . . . . . W W W W . . . . . . . W W W W W W |
| . . . . . . . . W W . . . . . . . . W W W W W W |
| . . . . . . . . . . . . . . . . . . W W W W W . |
| . . . . . . . . . . . . . . . . . . W W W W . . |
| . . . . . . . . . . . . . . . . . . W W W . . . |
| . . . . . . . . . . . . . . . . . . W W . . . . |
| . . . . . B . . . . . . . . . . . . . . . . . . |
| . . . . B B . . . . . . . . . . . . . . . . . . |
| . . . B B B . . . . . . . . . . . . . . . . . . |
| . . B B B B . . . . . . . . . . . . . . . . . . |
| . B B B B B . . . . . . . . . B B . . . . . . . |
| B B B B B B . . . . . . . . B B B B . . . . . . |
| B B B B B B . . . . . . . B B B B B . . . . . . |
| B B B B B . . . . . . . B B B B B B . . . . . . |
| B B B B . . . . . . . . B B B B B B . . . . . . |
| B B B . . . . . . . . . B B B B B B . . . . . . |
| B B . . . . . . . . . . B B B B B B . . . . . . |
| B . . . . . . . . . . . B B B B B B . . . . . . |
+-------------------------------------------------+
(End)
Example of an alternative n=20, 58-queen arrangement with "cracked" blocks from _Bob Selcoe_, May 23 2017:
+-----------------------------------------+
| . . . . . W W W W W . . . . . . . . W . |
| . . . . . W W W W W . . . . . . . W . W |
| . . . . . W W W W W . . . . . . W . W W |
| . . . . . W W W W W . . . . . W . W W W |
| . . . . . W W W W . . . . . . . W W W W |
| . . . . . W W W . . . . . . . W W W W W |
| . . . . . . W . . . . . . . . W W W W . |
| . . . . . . . . . . . . . . . W W W . . |
| . . . . . . . . . . . . . . . W W . . . |
| . . . . . . . . . W . . . . . W . . . . |
| . . . B B . . . . . . . . . . . . . . . |
| . . B B B . . . . . . . . . . . . . . . |
| . B B B B . . . . . . . . . . . . . . . |
| B B B B B . . . . . . . B . . . . . . . |
| B B B B . . . . . . . B B B . . . . . . |
| B B B . B . . . . . B B B B B . . . . . |
| B B . B . . . . . . B B B B B . . . . . |
| B . B . . . . . . . B B B B B . . . . . |
| . B . . . . . . . . B B B B B . . . . . |
| B . . . . . . . . . B B B B B . . . . . |
+-----------------------------------------+
.
n = 24: An 84-queen arrangement found by _Benoit Jubin_, Feb 24 2015 (see Comments above).
+-------------------------------------------------+
| . . . . . . W W W W W W . . . . . . . . . . . . |
| . . . . . . W W W W W W . . . . . . . . . . . W |
| . . . . . . W W W W W W . . . . . . . . . . W W |
| . . . . . . W W W W W W . . . . . . . . . W W W |
| . . . . . . W W W W W W . . . . . . . . W W W W |
| . . . . . . W W W W W . . . . . . . . W W W W W |
| . . . . . . . W W W . . . . . . . . W W W W W W |
| . . . . . . . . W . . . . . . . . . W W W W W W |
| . . . . . . . . . . . . . . . . . . W W W W W W |
| . . . . . . . . . . . . . . . . . . W W W W W . |
| . . . . . . . . . . . . . . . . . . W W W W . . |
| . . . . . . . . . . . . . . . . . . W W W . . . |
| . . . . B B . . . . . . . . . . . . . . . . . . |
| . . . B B B . . . . . . . . . . . . . . . . . . |
| . . B B B B . . . . . . . . . . . . . . . . . . |
| . B B B B B . . . . . . . . . . . . . . . . . . |
| B B B B B B . . . . . . . . . . B . . . . . . . |
| B B B B B B . . . . . . . . . B B B . . . . . . |
| B B B B B B . . . . . . . . B B B B . . . . . . |
| B B B B B . . . . . . . . B B B B B . . . . . . |
| B B B B . . . . . . . . B B B B B B . . . . . . |
| B B B . . . . . . . . . B B B B B B . . . . . . |
| B B . . . . . . . . . . B B B B B B . . . . . . |
| B . . . . . . . . . . . B B B B B B . . . . . . |
+-------------------------------------------------+
.
A solution for n = 27 with 106 queens found by _Dmitry Kamenetsky_, Oct 18 2019
+-------------------------------------------------------+
| . . . . . . . . . . . . W W W W W W W . . . . . . . . |
| . . . . . . . . . . . . W W W W W W W . . . . . . . . |
| W . . . . . . . . . . . W W W W W W W . . . . . . . . |
| W W . . . . . . . . . . W W W W W W W . . . . . . . . |
| W W W . . . . . . . . . W W W W W W W . . . . . . . . |
| W W W W . . . . . . . . . W W W W W W . . . . . . . . |
| W W W W W . . . . . . . . . W W W W W . . . . . . . . |
| W W W W W W . . . . . . . . . W W W . . . . . . . . . |
| W W W W W W . . . . . . . . . . W . W . . . . . . . . |
| W W W W W W . . . . . . . . . . . W . . . . . . . . . |
| W W W W W W . . . . . . . . . . . . . . . . . . . . . |
| . W W W W W . . . . . . . . . . . . . . . . . . . . . |
| . . W W W W . . . . . . . . . . . . . . . . . . . . . |
| . . . W W W . . . . . . . . . . . . . . . . . . . . . |
| . . . . W W . . . . . . W . . . . . . . . . . . . . . |
| . . . . . . . . . . . . . . . . . . . B B B B . . . . |
| . . . . . . . . . . . . . . . . . . . B B B B B . . . |
| . . . . . . . . . . . . . . . . . . . B B B B B B . . |
| . . . . . . . B . . . . . . . . . . . B B B B B B B . |
| . . . . . . B . B . . . . . . . . . . B B B B B B B B |
| . . . . . . . B B B . . . . . . . . . B B B B B B B B |
| . . . . . . B B B B B . . . . . . . . . B B B B B B B |
| . . . . . . B B B B B B . . . . . . . . . B B B B B B |
| . . . . . . B B B B B B . . . . . . . . . . B B B B B |
| . . . . . . B B B B B B . . . . . . . . . . . B B B B |
| . . . . . . B B B B B B . . . . . . . . . . . . B B B |
| . . . . . . B B B B B B . . . . . . . . . . . . . B B |
+-------------------------------------------------------+
		

References

  • Stephen Ainley, Mathematical Puzzles. London: G Bell & Sons, 1977.
  • Donald E. Knuth, Satisfiability, Fascicle 6, volume 4 of The Art of Computer Programming. Addison-Wesley, 2015, page 180, Problem 488; see also pp. 282-283.

Crossrefs

A260680 gives number of solutions.
Cf. A002620, A274947, A274948, A286283 (lower bound).
See A000170, A002562, A319284, etc., for the classic non-attacking queens problem.
See also A279405 (torus version), A176222 (peaceable kings), A002620 (peaceable rooks), A355509 (peaceable knights).

Formula

There is an asymptotic lower bound of (9/64)*n^2. But see Comments for a better lower bound.

Extensions

Uniqueness of n = 5 example corrected by Rob Pratt, Nov 30 2014
a(12)-a(13) obtained from Prestwich/Beck paper by Rob Pratt, Nov 30 2014
More examples from Rob Pratt, Dec 01 2014
a(1)-a(13) confirmed and bounds added for n = 14 to 20 obtained via integer linear programming by Rob Pratt, Dec 01 2014
28 <= a(14) <= 43, 32 <= a(15) <= 53, 37 <= a(16) <= 64, 42 <= a(17) <= 72, 47 <= a(18) <= 81, 52 <= a(19) <= 90, 58 <= a(20) <= 100. - Rob Pratt, Dec 01 2014
Bounds obtained by simulated annealing: a(21) >= 64, a(22) >= 70, a(23) >= 77, a(24) >= 84. - Peter Karpov, Apr 03 2016
a(14)-a(15) from Paul Tabatabai using integer programming, Oct 16 2018
Edited by N. J. A. Sloane, Nov 18 2018 to include comments from Benoit Jubin, Feb 24 2015 which were posted to the Sequence Fans Mailing List but were not added to this entry until today.
Counts for n=4 edited by N. J. A. Sloane, Mar 19 2019. See A260680 for more information.

A269133 Number of ways to place m nonattacking queens on an m X n board, 1 <= m <= n (triangular array).

Original entry on oeis.org

1, 2, 0, 3, 2, 0, 4, 6, 4, 2, 5, 12, 14, 12, 10, 6, 20, 36, 46, 40, 4, 7, 30, 76, 140, 164, 94, 40, 8, 42, 140, 344, 568, 550, 312, 92, 9, 56, 234, 732, 1614, 2292, 2038, 1066, 352, 10, 72, 364, 1400, 3916, 7552, 9632, 7828, 4040, 724, 11, 90, 536, 2468, 8492, 21362, 37248, 44148, 34774, 15116, 2680, 12, 110, 756, 4080, 16852, 52856, 120104, 195270, 222720, 160964, 68264, 14200
Offset: 1

Views

Author

Marko Riedel, Feb 19 2016

Keywords

Examples

			The triangular array begins:
   n\m  1   2   3    4     5     6      7      8      9     10    11    12
   1    1
   2    2   0
   3    3   2   0
   4    4   6   4    2
   5    5  12  14   12    10
   6    6  20  36   46    40     4
   7    7  30  76  140   164    94     40
   8    8  42 140  344   568   550    312     92
   9    9  56 234  732  1614  2292   2038   1066    352
  10   10  72 364 1400  3916  7552   9632   7828   4040    724
  11   11  90 536 2468  8492 21362  37248  44148  34774  15116  2680
  12   12 110 756 4080 16852 52856 120104 195270 222720 160964 68264 14200
...
		

Crossrefs

Cf. A000027 (m=1), A002378 (m=2), A061989 (m=3), A061990 (m=4), A061991 (m=5), A061992 (m=6), A061993 (m=7), A172449 (m=8).
Cf. A036464 (2Q), A047659 (3Q), A061994 (4Q), A108792 (5Q), A176186 (6Q).
Cf. A006717, A051906, A319284 (backtrack trees).

Programs

  • PARI
    {A269133(m, n, B=[], t=if(#B, setminus(n, Set(concat(B+t=[-#B..-1], B-t))), n=[1..n]))= if(#B < m-1, vecsum([A269133(m, setminus(n, [t]), concat(B,t)) | t<-t]), #t)} \\ M. F. Hasler, Jan 11 2022

A319283 Number of nodes of the backtrack tree for the n queens problem.

Original entry on oeis.org

1, 2, 3, 6, 17, 54, 153, 552, 2057, 8394, 35539, 166926, 856189, 4674890, 27358553, 171129072, 1141190303, 8017021932, 59365844491, 461939618824
Offset: 0

Views

Author

Peter Luschny, Sep 16 2018

Keywords

References

  • D. E. Knuth, The Art of Computer Programming, Volume 4, Pre-fascicle 5B, Introduction to Backtracking, 7.2.2. Backtrack programming. 2018.

Crossrefs

Row sums of A319284.
Cf. A000170.
Showing 1-5 of 5 results.