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.

Previous Showing 71-80 of 89 results. Next

A319235 The profile of the backtrack tree for the eight queens problem.

Original entry on oeis.org

1, 8, 42, 140, 344, 568, 550, 312, 92
Offset: 0

Views

Author

Peter Luschny, Sep 15 2018

Keywords

Comments

The profile (p_0, p_1, ..., p_n) is the number of nodes at each level of the tree.
The backtrack tree as defined by Knuth has for the eight queens problem 2057 nodes.

References

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

Crossrefs

Formula

a(8) = A000170(8), the number of solutions.

A319236 The profile of the backtrack tree for the sixteen queens problem.

Original entry on oeis.org

1, 16, 210, 2236, 19688, 141812, 838816, 3998456, 15324708, 46358876, 108478966, 193892860, 260303408, 253897632, 171158018, 72002088, 14772512
Offset: 0

Views

Author

Peter Luschny, Sep 15 2018

Keywords

Comments

The profile (p_0, p_1, ..., p_n) is the number of nodes at each level of the tree.
The backtrack tree as defined by Knuth has for the sixteen queens problem 1141190303 nodes.

References

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

Crossrefs

Formula

a(16) = A000170(16), the number of solutions.

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.

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

A343905 Number of ways of placing n nonattacking range-3 leprechauns on an n X n board.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 34, 4, 112, 516, 7312, 81324, 1056560, 13443944, 171919446, 2195838076, 28876216900, 379982087060
Offset: 1

Views

Author

Guillaume Escamocher, May 03 2021

Keywords

Comments

First 25 terms were computed by Vaclav Kotesovec in 2020.
A range-k leprechaun is a fairy chess piece that can move to any square within range k, and to any square that a queen can move to (Escamocher and O'Sullivan 2021). A range-1 leprechaun is a queen, a range-2 leprechaun is a superqueen.

Crossrefs

Extensions

a(26)-a(27) from Martin Ehrenstein, May 06 2021
a(26) confirmed by Vaclav Kotesovec, Jun 07 2021
a(28) from Martin Ehrenstein, Oct 14 2021

A344227 Sprague-Grundy value for the Node-Kayles game played on the n-queens graph.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 2, 3, 1, 0, 1, 0, 1
Offset: 0

Views

Author

Max Fan and Matthew K. Bardoe, May 13 2021

Keywords

Comments

This game is also known as the Non-Attacking Queens game. Rules: two players successively place queens on an n X n chessboard such that the queens do not attack each other. The last player to place a queen wins.
Empirically, it appears that after the 9th term, the sequence oscillates between 1 and 0.
The n-queens graph considered here is not vertex-transitive. However, the toroidal version is and for Node-Kayles played on graphs that are vertex-transitive, it can be proven that the Sprague-Grundy value must be either 0 or 1.
Proof:
Each node in a graph that is transitive for all vertices has the same Sprague-Grundy value, since removing any node and its neighbors will produce identical graphs up to isomorphism.
This Sprague-Grundy value of the new graph must be either zero or nonzero.
If zero, then by the minimum exclusion principle, the value of the original graph is 1.
If nonzero, then by the minimum exclusion principle, the value of the original graph is 0.
Therefore, the Sprague-Grundy value of the original, vertex-transitive graph must be either 0 or 1.

References

  • G. Schrage, The eight queens problem as a strategy game, Int. J. Math. Educ. Sci. Technol. 17 (1989) 143-148. (mentions a restricted form of the Non-Attacking Queens game).

Crossrefs

Programs

  • Haskell
    pickCoords n = sequence (replicate 2 [0..n-1])
    mex list = head (filter (`notElem` list) [0..(maximum list+1)])
    checkIntersect [x,y] [n,m] = not (x == n || y == m) && (abs (x-n) /= abs (y-m))
    nextMoves max history = filter (\move -> null history || all (checkIntersect move) history) (pickCoords max)
    calcNimber max history | null (nextMoves max history) = 0 | otherwise = mex (map (\move -> calcNimber max (history ++ [move])) (nextMoves max history))
    a344227 n = calcNimber n []
  • Rust
    // See Fan link.
    

A383738 Number of solutions to the n-queens puzzle in a n X n board that are not square root permutations of {n-1,...,2,1,0}.

Original entry on oeis.org

0, 0, 0, 0, 8, 4, 40, 92, 352, 724, 2680, 14192, 73704, 365596, 2279184, 14772448, 95814976, 666090624, 4968057848, 39029188404, 314666222008, 2691008701644, 24233937684440, 227514171970408, 2207893435805088, 22317699616364044, 234907967154122528
Offset: 1

Views

Author

Darío Clavijo, May 07 2025

Keywords

Comments

Each solution to the n-queens problem can be represented as a permutation of {0,1,2,...,n-1}.
Conversely, the number of solutions to the n-queens puzzle in a n X n board that are also square root permutations of {n-1,...,2,1,0} is A033148.
a(n) is always even because every solution to the puzzle has its own reflection in the horizontal axis, e.g., {0,2,4,1,3} and {3,1,4,2,0}.

Examples

			For n = 5, we have:
     0 1 2 3 4      0 1 2 3 4      0 1 2 3 4      0 1 2 3 4      0 1 2 3 4
   +-----------+  +-----------+  +-----------+  +-----------+  +-----------+
 0 | Q         |  | Q         |  |   Q       |  |   Q       |  |     Q     |
 1 |     Q     |  |       Q   |  |       Q   |  |         Q |  | Q         |
 2 |         Q |  |   Q       |  | Q         |  |     Q     |  |       Q   |
 3 |   Q       |  |         Q |  |     Q     |  | Q      Q  |  |   Q       |
 4 |      Q    |  |     Q     |  |         Q |  |           |  |         Q |
   +-----------+  +-----------+  +-----------+  +-----------+  +-----------+
     0,2,4,1,3      0,3,1,4,2      1,3,0,2,4      1,4,2,0,3      2,0,3,1,4
is sqrt perm: no             no           no            yes              no
     0 1 2 3 4      0 1 2 3 4      0 1 2 3 4      0 1 2 3 4      0 1 2 3 4
   +-----------+  +-----------+  +-----------+  +-----------+  +-----------+
 0 |     Q     |  |       Q   |  |       Q   |  |         Q |  |         Q |
 1 |         Q |  | Q         |  |   Q       |  |   Q       |  |     Q     |
 2 |   Q       |  |     Q     |  |         Q |  |       Q   |  | Q         |
 3 |       Q   |  |         Q |  |     Q     |  | Q         |  |       Q   |
 4 | Q         |  |   Q       |  | Q         |  |     Q     |  |   Q       |
   +-----------+  +-----------+  +-----------+  +-----------+  +-----------+
    2,4,1,3,0      3,0,2,4,1       3,1,4,2,0      4,1,3,0,2      4,2,0,3,1
is sqrt perm: no            yes           no            no              no
In total there are 10 solutions for a 5 X 5 board with 5 queens, of which 8 are not square root permutations of {n-1,...,2,1,0}.
Then, a(5) = 10.
		

Crossrefs

Formula

a(n) = A000170(n) - A033148(n).

A137279 Number of ways of placing ceiling(n/2) nonattacking queens on an n X n Mobius chessboard.

Original entry on oeis.org

1, 4, 0, 16, 40, 192, 560, 3328, 11772, 63840, 259336, 1550976, 7169656, 42410256, 234044160, 1366190592
Offset: 1

Views

Author

Brett Stevens (brett(AT)math.carleton.ca), Mar 13 2008

Keywords

Comments

The chessboard is an n X n standard chessboard whose left and right edges are twisted connected.

Examples

			a(4)=16 because any queen attacks all but two other squares and every solution is counted twice by enumerating all such placements.
		

Crossrefs

A168553 a(n) = 1 if it is possible to place n sets of n queens on an n X n chessboard with no two queens of the same set attacking each other.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1
Offset: 1

Views

Author

Howard A. Landman, Nov 29 2009

Keywords

Comments

Obviously this sequence must be a subset of the positive integers for which a single n-queens solution exists, which is all integers except 2 and 3. It is a proper subset, because e.g. there is a single-set solution for 4 X 4 or 8 X 8 but no n-set solution. George Polya showed that a doubly periodic solution for the n-queens problem exists if and only if n = 1 or 5 (mod 6). For years, due to this result, it was assumed that this defined the sequence, which would then have been an infinite repetition of 1,0,0,0,1,0. However, Patrick Hamlyn and Guenter Stertenbrink tried brute force on 12 X 12 and found 178 12-set solutions built from non-doubly-periodic sets. Thus the Polya condition only provides a lower bound, and the exact continuation of this sequence is an open research question.

Examples

			For n=1 a single queen is a solution. For n=2 or 3 there is no single-set solution. For n=4, there are 2 single-set solutions, and they can both fit on the board together, but these are insufficient to make a 4-set solution. For n=5, there is a doubly-periodic single-set solution by Polya's construction, which can be tiled to make a 5-set solution
		

References

  • G. Polya, Uber die 'doppelt-periodischen' Losungen des n-Damen-Problems. In Mathematische Unterhaltungen und Spiele, W. Ahrens, Ed., Teubner, Leipzig, 1918, pp. 364-374.

Crossrefs

A000170 gives the number of single-set solutions. A007705 gives the number of Polya-style doubly-periodic single-set solutions (with even n omitted since they are all 0).

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

Previous Showing 71-80 of 89 results. Next