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

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.

A000560 Number of ways of folding a strip of n labeled stamps.

Original entry on oeis.org

1, 2, 5, 12, 33, 87, 252, 703, 2105, 6099, 18689, 55639, 173423, 526937, 1664094, 5137233, 16393315, 51255709, 164951529, 521138861, 1688959630, 5382512216, 17547919924, 56335234064, 184596351277, 596362337295, 1962723402375
Offset: 2

Views

Author

Keywords

References

  • A. Sade, Sur les Chevauchements des Permutations, published by the author, Marseille, 1949.
  • 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).
  • M. B. Wells, Elements of Combinatorial Computing. Pergamon, Oxford, 1971, p. 238.

Crossrefs

Programs

Formula

a(n) = (1/2)*A000682(n+1) for n >= 2.
a(n) = A000136(n+1)/(2*n+2) for n >= 2. - Jean-François Alcover, Sep 06 2019 (from formula in A000136)

Extensions

Computed to n = 45 by Iwan Jensen - see link in A000682.

A274651 Triangle read by rows: T(n,k), (1<=k<=n), in which each term is the least positive integer such that no row, column, diagonal, or antidiagonal contains a repeated term.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jul 02 2016

Keywords

Comments

Analog of A269526, but note that this is a right triangle.
The same rule applied to an equilateral triangle gives A269526.
We construct the triangle by reading from left to right in each row, starting with T(1,1) = 1.
Presumably every diagonal and every column is also a permutation of the positive integers, but the proof does not seem so straightforward. Of course, neither the rows nor the antidiagonals are permutations of the positive integers, since they are finite in length.
Omar E. Pol's conjecture that every column and every diagonal of the triangle is a permutation of the positive integers is true: see the link in A274650 (duplicated below). - N. J. A. Sloane, Jun 07 2017
It appears that the numbers generally appear for the first time in or near the right border of the triangle.
Theorem 1: the middle diagonal gives A000012 (the all 1's sequence).
Theorem 2: all 1's are in the middle diagonal.
For the proofs of the theorems 1 and 2 see the proofs of the theorems 1 and 2 of A274650 since both sequences are essentially the same.
From Bob Selcoe, Feb 15 2017: (Start)
The columns and diagonal are permutations of the natural numbers. The proofs are essentially the same as the proofs given for the columns and rows (respectively) in A269526.
All coefficients j <= 4 eventually populate in a repeating pattern toward the "middle diagonal" (i.e., relatively near the 1's); this is because we can build the triangle by j in ascending order; that is, we can start by placing all the 1's in the proper cells, then add the 2's, 3's, 4's, 5's, etc. So for i >= 0: since the 1's appear at T(1+2i, 1+i), the 2's appear at T(2+8i, 1+4i), T(3+8i, 3+4i), T(5+8i, 2+4i) and T(6+8i, 4+4i). Accordingly, after the first five 3's appear (at T(2,2), T(4,1), T(5,4), T(7,3) and T(8,6)), the remaining 3's appear at T(11+8i, 5+4i), T(12+8i, 7+4i), T(16+8i, 8+4i) and T(17+8i, 10+4i). Similarly for 4's, after the first 21 appearances, 4's appear at T(44+8i, 21+4i), T(45+8i, 24+4i), T(47+8i, 23+4i) and T(48+8i, 26+4i). So starting at T(41,21), this 16-coefficient pattern repeats at T(41+8i, 21+4i):
n/k 21 22 23 24 25 26
41 1 3
42 2
43 3 1 2
44 4 3
45 2 1 4
46 2
47 4 1
48 3 4
where the next 1 appears at T(49,25), and the pattern repeats at that point from the top left (so T(49,26) = 3, T(50,25) = 2, etc.).
Conjecture: as n gets sufficiently large, all coefficients j>4 will appear in a repeating pattern, populating all rows and diagonals around smaller j's near the "middle diagonal" (while I can offer no formal proof, it appears very likely that this is the case). (End)
From Hartmut F. W. Hoft, Jun 12 2017: (Start)
T(2k+1,k+1) = 1, for all k>=0, and T(n,{n/2,(n+3)/2,(n-1)/2,(n+2)/2}) = 2, for all n>=1 with mod(n,8) = {2,3,5,6} respectively, and no 1's or 2's occur in other positions.
Proof by (recursive) picture:
Positions in the triangle that are empty and those containing the dots of the guiding diagonals contain numbers larger than two.
n\k 1 2 3 4 5 6 7 8 10 12 14 16 18 20 22 24
1 |1
2 |2 .
3 | 1 2
4 | .
5 | 2 1 .
6 | 2 .
7 | 1 .
9 | |1 .
10 | |2 . .
11 | | 1 2 .
12 | | . .
13 | | 2 1 . .
14 | | 2 . .
15 | | 1 . .
16 |_____|______________._____.
17 | | |1 . .
18 | | |2 . . .
19 | | | 1 2 . .
20 | | | . . .
21 | | | 2 1 . . .
22 | | | 2 . . .
23 | | | 1 . . .
24 |_____|_______|____._______._____._______.
1 2 3 4 5 6 7 8 12 16 20 24
Consider the center of the triangle. In each octave of rows the columns in the first central quatrain contain a 1 and a 2, and the diagonals in the second central quatrain contain a 1 and a 2. Therefore, no 1's or 2's can occur in the respective downward quatrains of leading columns and trailing diagonals.
The sequence of rows containing 2's is A047447 (n mod 8 = {2,3,5,6}), those containing only 2's is A016825 (n mod 8 = {2,6}), those containing both 1's and 2's is A047621 (n mod 8 = {3,5}), those containing only 1's is A047522 (n mod 8 = {1,7}), and those containing neither 1's nor 2's is A008586 (n mod 8 = {0,4}).
(End)

Examples

			Triangle begins:
   1;
   2,  3;
   4,  1,  2;
   3,  5,  4,  6;
   6,  2,  1,  3,  4;
   5,  4,  6,  2,  7,  8;
   7,  8,  3,  1,  6,  5,  9;
   9,  6, 10,  5,  8,  3, 11,  7;
   8, 11,  9,  4,  1,  7, 10,  6,  5;
  12,  7, 13,  8,  2,  9,  4, 11, 10, 14;
  10,  9,  5, 12,  3,  1,  2, 13,  7,  8, 11;
  11, 12,  8, 13,  5,  4,  3, 10,  9, 15, 14, 16;
  13, 10, 11,  7,  9,  2,  1, 12,  8,  5, 17, 15, 18;
  ...
From _Omar E. Pol_, Jun 07 2017: (Start)
The triangle may be reformatted as an isosceles triangle so that the all 1's sequence (A000012) appears in the central column (but note that this is NOT the way the triangle is constructed!):
.
.                  1;
.                2,  3;
.              4,  1,  2;
.            3,  5,  4,  6;
.          6,  2,  1,  3,  4;
.        5,  4,  6,  2,  7,  8;
.      7,  8,  3,  1,  6,  5,  9;
.    9,  6, 10,  5,  8,  3, 11,  7;
.  8, 11,  9,  4,  1,  7, 10,  6,  5;
...
(End)
		

Crossrefs

Cf. A001844 (indices of the 1's).
Cf. A000012 (middle diagonal).
Every diagonal and every column of the right triangle is a permutation of A000027.
Cf. A274650 is the same triangle but with every entry minus 1.
Other sequences of the same family are A269526, A274528, A274820, A274821, A286297, A288530, A288531.
Sequences mentioned in N. J. A. Sloane's proof are A000170, A274616 and A287864.

Programs

  • Mathematica
    f[1,1] = 1; (* for 1 < n and 1 <= k <= n *)
    f[n_,k_] := f[n,k] = Module[{vals=Sort[Join[Map[f[n, #]&, Range[1, k-1]], Map[f[#, k]&, Range[k, n-1]], Map[f[n-k+#, #]&, Range[1, k-1]], Map[f[n-#, k+#]&, Range[1, Floor[(n-k)/2]]]]], c}, c=Complement[Range[1, Last[vals]], vals]; If[c=={}, Last[vals]+1, First[c]]]
    (* computation of rows 1 ... n of triangle *)
    a274651[n_] := Prepend[Table[f[i, j], {i, 2, n}, {j, 1, i}], {1}]
    Flatten[a274651[13]] (* data *)
    TableForm[a274651[13]] (* triangle *)
    (* Hartmut F. W. Hoft, Jun 12 2017 *)

Formula

T(n,k) = A274650(n-1,k-1) + 1.

A348129 Number T(n,k) of ways to place k nonattacking queens on an n X n board; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 0, 1, 9, 8, 0, 1, 16, 44, 24, 2, 1, 25, 140, 204, 82, 10, 1, 36, 340, 1024, 982, 248, 4, 1, 49, 700, 3628, 7002, 4618, 832, 40, 1, 64, 1288, 10320, 34568, 46736, 22708, 3192, 92, 1, 81, 2184, 25096, 131248, 310496, 312956, 119180, 13848, 352, 1, 100, 3480, 54400, 412596, 1535440, 2716096, 2119176, 636524, 56832, 724
Offset: 0

Views

Author

Alois P. Heinz, Oct 01 2021

Keywords

Examples

			T(3,2) = 8:
  .-----. .-----. .-----. .-----. .-----. .-----. .-----. .-----.
  |Q . .| |Q . .| |. . Q| |. . Q| |. . .| |. Q .| |. Q .| |. . .|
  |. . Q| |. . .| |. . .| |Q . .| |Q . .| |. . .| |. . .| |. . Q|
  |. . .| |. Q .| |. Q .| |. . .| |. . Q| |. . Q| |Q . .| |Q . .|
  `-----´ `-----´ `-----´ `-----´ `-----´ `-----´ `-----´ `-----´.
Triangle T(n,k) begins:
  1;
  1,  1;
  1,  4,    0;
  1,  9,    8,     0;
  1, 16,   44,    24,      2;
  1, 25,  140,   204,     82,     10;
  1, 36,  340,  1024,    982,    248,      4;
  1, 49,  700,  3628,   7002,   4618,    832,     40;
  1, 64, 1288, 10320,  34568,  46736,  22708,   3192,    92;
  1, 81, 2184, 25096, 131248, 310496, 312956, 119180, 13848, 352;
  ...
		

Crossrefs

Main diagonal gives A000170.
Row sums give A287227.
T(2n,n) gives A348130.

A051906 Number of ways of placing n nonattacking queens on an n X n toroidal chessboard.

Original entry on oeis.org

1, 0, 0, 0, 10, 0, 28, 0, 0, 0, 88, 0, 4524, 0, 0, 0, 140692, 0, 820496, 0, 0, 0, 128850048, 0, 1957725000, 0, 0, 0, 605917055356, 0, 13404947681712, 0, 0, 0
Offset: 1

Views

Author

Matthias Engelhardt, Dec 17 1999

Keywords

Comments

The sequence has been computed up to n = 23 by Rivin, Vardi & Zimmermann, see p. 637 of their paper from 1994. Further terms were calculated by the submitter, Dec 17 1999 and Jan 11 2001.
a(n) is divisible by n.
Only terms indexed by odd numbers coprime to 3 are nonzero, therefore A007705(n) = a(2n+1) is the main entry. - M. F. Hasler, Jul 01 2019
From Eduard I. Vatutin, Nov 27 2023: (Start)
For n <= 11 all solutions can be found using a knight moving with some displacements dx and dy starting from some cell with coordinates (x,y): (x,y) -> (x+dx,y+dy) -> (x+2*dx,y+2*dy) -> ... -> (x,y) (all operations modulo n). For n >= 13 some solutions are same, but not all (see examples).
All solutions of n-queens problem on toroidal chessboard are also solutions of n-queens problem on classical chessboard; the converse is not true, so a(n) <= A000170(n).
(End)

Examples

			From _Eduard I. Vatutin_, Nov 27 2023: (Start)
n=5 (all 10 solutions are shown below):
+-----------+ +-----------+ +-----------+ +-----------+ +-----------+
| 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 . . . |
+-----------+ +-----------+ +-----------+ +-----------+ +-----------+
n=7:
+---------------+
| Q . . . . . . |
| . . . Q . . . |
| . . . . . . Q |
| . . Q . . . . |
| . . . . . Q . |
| . Q . . . . . |
| . . . . Q . . |
+---------------+
n=11:
+-----------------------+
| Q . . . . . . . . . . |
| . . Q . . . . . . . . |
| . . . . Q . . . . . . |
| . . . . . . Q . . . . |
| . . . . . . . . Q . . |
| . . . . . . . . . . Q |
| . Q . . . . . . . . . |
| . . . Q . . . . . . . |
| . . . . . Q . . . . . |
| . . . . . . . Q . . . |
| . . . . . . . . . Q . |
+-----------------------+
n=13 (first example can be found using a knight moving from cell (1,1) with dx=1 and dy=2, second example can't be obtained in the same way):
+---------------------------+ +---------------------------+
| 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 . . . . |
+---------------------------+ +---------------------------+
(End)
		

Crossrefs

See A007705, which is the main entry for this sequence.

Formula

a(n) = A071607((n-1)/2) * n for odd n. - Eduard I. Vatutin, Nov 27 2023, corrected Apr 10 2024

Extensions

Term a(31) added from A007705 by Vaclav Kotesovec, Aug 25 2012

A102388 Number of ways of placing n nonattacking Queens of the Night on an n X n board.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 44, 6, 78, 8, 16, 18, 234, 124, 468, 516, 882, 2092, 7068, 22794, 85456, 275732, 974048, 3698242, 14120996, 59531852, 252272512, 1163430462, 5229335374
Offset: 1

Views

Author

Stefan Wernli, Peter Syski (swernli(AT)fas.harvard.edu), Jan 07 2005

Keywords

Comments

A Queen of the Night can move like a Queen or a Nightrider, which is a rider along straight lines of Knight moves.

Crossrefs

Extensions

Terms a(20)-a(28) from Vaclav Kotesovec, Jun 18 2010 and Feb 02 2011
Terms a(29)-a(32) from Wolfram Schubert, Jul 24 2011
Term a(33) from Wolfram Schubert, May 27 2012

A274616 Maximal number of non-attacking queens on a right triangular board with n cells on each side.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47
Offset: 0

Views

Author

Rob Pratt and N. J. A. Sloane, Jul 01 2016

Keywords

Comments

This sequence was mentioned by R. K. Guy in the first comment in A004396.

Examples

			n=3:
OOX
XO
O
n=4:
OOOX
OXO
OO
O
n=5:
OOOOX
OOXO
XOO
OO
O
		

References

  • Paul Vanderlind, Richard K. Guy, and Loren C. Larson, The Inquisitive Problem Solver, MAA, 2002. See Problem 252, pages 67, 87, 198 and 276.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[x*(1 +x^2 -x^3)*(1 +x^4)/((1-x)^2*(1+x+x^2)), {x, 0, 50}], x] (* G. C. Greubel, Jul 03 2016 *)
  • PARI
    concat(0, Vec(x*(1+x^2-x^3)*(1+x^4)/((1-x)^2*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Jul 02 2016

Formula

Except for n=4, this is round(2n/3).
From Colin Barker, Jul 02 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>5.
G.f.: x*(1+x^2-x^3)*(1+x^4)/((1-x)^2*(1+x+x^2)). (End)
a(n) = 2*(3*n + sqrt(3)*sin((2*Pi*n)/3)) / 9. - Colin Barker, Mar 08 2017

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

A065256 Quintal Queens permutation of N: halve or multiply by 3 (mod 5) each digit (0->0, 1->3, 2->1, 3->4, 4->2) of the base 5 representation of n.

Original entry on oeis.org

0, 3, 1, 4, 2, 15, 18, 16, 19, 17, 5, 8, 6, 9, 7, 20, 23, 21, 24, 22, 10, 13, 11, 14, 12, 75, 78, 76, 79, 77, 90, 93, 91, 94, 92, 80, 83, 81, 84, 82, 95, 98, 96, 99, 97, 85, 88, 86, 89, 87, 25, 28, 26, 29, 27, 40, 43, 41, 44, 42, 30, 33, 31, 34, 32, 45, 48, 46, 49, 47, 35, 38
Offset: 0

Views

Author

Antti Karttunen, Oct 26 2001

Keywords

Comments

All the permutations A004515 and A065256-A065258 consist of the first fixed term ("Queen on the corner") plus infinitely many 4-cycles and they satisfy the "nonattacking queen condition" that p(i+d) <> p(i)+-d for all i and d >= 1.
The corresponding infinite permutation matrix is a scale-invariant fractal (cf. A048647) and any subarray (5^i) X (5^i) (i >= 1) cut from its corner gives a solution to the case n=5^i of the n nonattacking queens on n X n chessboard (A000170). Is there any permutation of N which would give solutions to the queen problem with more frequent intervals than A000351?

Crossrefs

Inverse permutation: A004515. A065256[n] = A065258[n+1]-1. Cf. also A065187, A065189.

Programs

  • Maple
    [seq(QuintalQueens0Inv(j),j=0..124)];
    HalveDigit := (d,b) -> op(2,op(1,msolve(2*x=d,b))); # b should be an odd integer >= 3 and d should be in range [0,b-1].
    HalveDigits := proc(n,b) local i; add((b^i)*HalveDigit((floor(n/(b^i)) mod b),b),i=0..floor(evalf(log[b](n+1)))+1); end;
    QuintalQueens0Inv := n -> HalveDigits(n,5);
  • Mathematica
    HalveDigit[d_, b_ /; OddQ[b] && b >= 3] /; 0 <= d <= b - 1 := Module[{x}, x /. Solve[2*x == d, x, Modulus -> b][[1]]];
    HalveDigits[n_, b_] := Sum[b^i*HalveDigit[Mod[Floor[n/b^i] , b], b], {i, 0, Floor[Log[b, n + 1]]}];
    QuintalQueens0Inv[n_] := HalveDigits[n, 5];
    Table[QuintalQueens0Inv[n], {n, 0, 80}] (* Jean-François Alcover, Mar 05 2016, adapted from Maple *)

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009

A189837 Number of ways to place n nonattacking composite pieces rook + rider[1,2] on an n X n chessboard.

Original entry on oeis.org

1, 2, 2, 8, 12, 22, 58, 276, 648, 2304, 6508, 24528, 96402, 466922, 2271738, 13723826, 76579326, 512425626, 3281233020, 24654941268, 175398054696
Offset: 1

Views

Author

Vaclav Kotesovec, Apr 29 2011

Keywords

Comments

(In fairy chess the rider [1,2] is called a Nightrider, Rook + Nightrider = Waran.)
a(n) is also the number of permutations p of 1,2,...,n satisfying |p(i+k) - p(i)| <> 2k AND |p(j+2k) - p(j)| <> k for all i >= 1, j >= 1, k >= 1, i+k <= n, j+2k <= n.

Crossrefs

Previous Showing 11-20 of 89 results. Next