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 20 results. Next

A007630 Duplicate of A002562.

Original entry on oeis.org

46, 92, 341, 1787, 9233, 45752, 285053, 1846955
Offset: 9

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

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.

A051224 Number of ways of placing n nonattacking superqueens on n X n board (symmetric solutions count only once).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 22, 239, 653, 4089, 25411, 166463, 1115871, 8062150, 61984976, 497236090, 4261538564, 38352532487, 360400504834, 3518014210402, 35752764285788
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

A superqueen moves like a queen and a knight.
Superqueens are also called amazons.

References

  • D. E. Knuth, The Art of Computer Programming, Section 7.2.2.3 (draft, March 2022)

Crossrefs

Formula

a(n) = (1/8) * (Q(n) + P(n) + 2 * R(n)), where Q(n) = A051223(n) [all solutions], P(n) [point symmetric solutions (180 degrees)] and R(n) [rotationally symmetric solutions (90 degrees)]. This formula has the same structure as the formula for A002562. There seem to be no OEIS sequences (yet) for P(n) and R(n). See the N-Queens page link. - W. Schubert, Nov 29 2009

Extensions

a(20) from Bill link added Jul 25 2006
a(21)..a(22) added from Bill's website. Max Alekseyev, Oct 19 2008
Added formula and a(23)..a(25) derived by formula. W. Schubert, Nov 29 2009
Added a(26). W. Schubert, Jan 18 2011

A033148 Number of rotationally symmetric solutions for queens on n X n board.

Original entry on oeis.org

1, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 64, 128, 0, 0, 480, 704, 0, 0, 3328, 3264, 0, 0, 32896, 43776, 0, 0, 406784, 667904, 0, 0, 5845504, 8650752, 0, 0, 77184000, 101492736, 0, 0, 1261588480, 1795233792, 0, 0, 21517426688, 35028172800, 0, 0, 406875119616, 652044443648, 0, 0, 8613581094912, 12530550128640, 0, 0, 194409626533888, 291826098503680, 0, 0
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

Comments

From Don Knuth, Jul 17 2015: (Start)
Ahrens proved that a(n)=0 unless n=4k or 4k+1. He also proved that in the latter case, a(n) is a multiple of 2^k. He found all solutions when n was less than 20.
Kraitchik carried the calculations further (for n less than 28). In his book he tabulated only the values a(n)/2^k. He had correct entries for n=21 and n=25, but his values for n=20 and n=24 were 1 too small -- of course he had calculated everything by hand! (End)

References

  • W. Ahrens, Mathematische Unterhaltungen und Spiele, 2nd edition, volume 1, Teubner, 1910, pages 249-258.
  • Maurice Kraitchik, Le problème des reines, Bruxelles: L'Échiquier, 1926, page 18.

Crossrefs

Extensions

More terms from Jieh Hsiang and YuhPyng Shieh (arping(AT)turing.csie.ntu.edu.tw), May 20 2002

A032522 Number of point symmetric solutions to non-attacking queens problem on n X n board.

Original entry on oeis.org

1, 0, 0, 2, 2, 4, 8, 4, 16, 12, 48, 80, 136, 420, 1240, 3000, 8152, 18104, 44184, 144620, 375664, 1250692, 3581240, 11675080, 34132592, 115718268, 320403024, 1250901440, 3600075088, 14589438024, 43266334696, 181254386312
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

References

  • 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.

Crossrefs

Extensions

More terms for n = 33..36 from W. Schubert, Jul 31 2009

A260318 Number of doubly symmetric characteristic solutions to the n-queens problem.

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 32, 64, 0, 0, 240, 352, 0, 0, 1664, 1632, 0, 0, 16448, 21888, 0, 0, 203392, 333952, 0, 0, 2922752, 4325376, 0, 0, 38592000, 50746368, 0, 0, 630794240, 897616896, 0, 0, 10758713344, 17514086400, 0, 0, 203437559808, 326022221824, 0, 0, 4306790547456, 6265275064320, 0, 0, 97204813266944, 145913049251840, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Jul 22 2015

Keywords

Comments

The problem of placing eight queens on a chessboard so that no one of them can take any other in a single move is a particular case of the more general problem: On a square array of n X n cells place n objects, one on each of n different cells, in such a way that no two of them lie on the same row, column, or diagonal.
There are no (interesting) doubly centrosymmetric solutions for n < 4, and there is just one complete set for n = 4: 2413, 3142 and one for n = 5: 25314, 41352.
On the ordinary chessboard of 8 X 8 cells there are a total of 92 solutions, consisting of 11 sets of equivalent ordinary solutions and one set of equivalent symmetric solutions. There are no doubly symmetric solutions in this case.

References

  • Maurice Kraitchik: Mathematical Recreations. Mineola, NY: Dover, 2nd ed. 1953, pp. 247-255 (The Problem of the Queens).

Crossrefs

Formula

a(n) = A033148(n) / 2 for n >= 2. - Don Knuth, Jun 20 2017

Extensions

More terms, due to Don Knuth, added by Colin Barker, Jun 20 2017

A260319 Number of singly symmetric characteristic solutions to the n-queens problem.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 1, 4, 3, 12, 18, 32, 105, 310, 734, 2006, 4526, 11046, 36035, 93740, 312673, 895310, 2917938, 8532332, 28929567
Offset: 1

Views

Author

N. J. A. Sloane, Jul 22 2015

Keywords

Comments

The problem of placing eight queens on a chessboard so that no one of them can take any other in a single move is a particular case of the more general problem: On a square array of n X n cells place n objects, one on each of n different cells, in such a way that no two of them lie on the same row, column, or diagonal.
There are no centrosymmetric solutions for n < 6, if by "centrosymmetric" we exclude "doubly symmetric" cases; and there is just one complete set for n = 6: 246135, 362514, 415263, 531642.
On the ordinary chessboard of 8 X 8 cells there are a total of 92 solutions, consisting of 11 sets of equivalent ordinary solutions and one set of equivalent symmetric solutions. There are no doubly symmetric solutions in this case. These sets may be generated in the ordinary case by 15863724, 16837425, 24683175, 2571384, 25741863, 26174835, 26831475, 27368514, 27581463, 35841726, 36258174 and in the symmetric case by 35281746.

References

  • Maurice Kraitchik: Mathematical Recreations. Mineola, NY: Dover, 2nd ed. 1953, p. 247-255 (The Problem of the Queens).

Crossrefs

Formula

a(n) = -A000170(n)/4 + 2*A002562(n) - 3*A260318(n)/2, n > 1. - R. J. Mathar, Jul 24 2015

Extensions

Name edited (by inserting "singly", since "doubly symmetric" solutions are symmetric but not counted here) by Don Knuth, Mar 25 2022

A260320 Number of asymmetric characteristic solutions to the n-queens problem.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 4, 11, 42, 89, 329, 1765, 9197, 45647, 284743, 1846189, 11975869, 83259065, 621001708, 4878630533, 39333230881, 336375931369, 3029241762900, 28439270037332, 275986675209470, 2789712437580722
Offset: 1

Views

Author

N. J. A. Sloane, Jul 22 2015

Keywords

Comments

The problem of placing eight queens on a chessboard so that no one of them can take any other in a single move is a particular case of the more general problem: On a square array of n X n cells place n objects, one on each of n different cells, in such a way that no two of them lie on the same row, column, or diagonal.
There are no ordinary solutions for n < 5, and there is just one complete set of ordinary solutions for n = 5: 13524, 52413, 24135, 35241, 53142, 14253, 42531, 31425 (generated by reflection and rotation).
On the ordinary chessboard of 8 X 8 cells there are a total of 92 solutions, consisting of 11 sets of equivalent ordinary solutions and one set of equivalent symmetric solutions. There are no doubly symmetric solutions in this case. These sets may be generated in the ordinary case by 15863724, 16837425, 24683175, 2571384, 25741863, 26174835, 26831475, 27368514, 27581463, 35841726, 36258174 and in the symmetric case by 35281746.

References

  • W. Ahrens, Mathematische Unterhaltungen und Spiele, second edition (1910), see page 231.
  • Maurice Kraitchik: Mathematical Recreations. Mineola, NY: Dover, 2nd ed. 1953, pp. 247-255 (The Problem of the Queens).

Crossrefs

Formula

a(n) = -A002562(n) + A000170(n)/4 + A260318(n)/2 (n>1). - R. J. Mathar, Jul 24 2015

Extensions

Offset corrected by Michael Somos, Jun 19 2017

A062164 Number of ways of placing n nonattacking (normal) queens on n X n board; solutions congruent on the torus count only once.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 3, 6, 20, 40, 191, 953, 4604, 24660, 158466, 1009395
Offset: 1

Views

Author

Keywords

Comments

In this sequence two n-queens solutions p and q are considered equivalent iff there are natural numbers x and y such that, for all k from {0, ..., n-1}, q (k + x mod n) = p (k) + y mod n, or q is a rotation or a reflection of such a q.
In other words, besides rotations and reflections, also torus shifts are allowed. The sequence reduces the objects of A002562 and via that of A000170. The reduction of A000170 to this sequence is exactly the same as from A007705 to A053994 for torus queens; however, a solution for torus queens remains always a solution after a shift while a normal queens solutions does so only sometimes.
Note that the equivalence classes of this sequence are a subset of A006841. Moreover they are a subset of A062167.

Extensions

Updated link that is transferred from people.freenet.de/nQueens to www.nqueens.de Matthias Engelhardt, Apr 21 2010
Showing 1-10 of 20 results. Next