Skip to: ContentEnd

Lyndenlea

My home on the Web

The First Solutions

This page lists the first possible solutions to the n Queens problem for various sizes of chessboard, and the numbers of Queens it is necessary to place whilst seeking those first solutions using our algorithm.

With three notable exceptions, the final Queen to be placed completes the first solution. Two of those exceptions are chessboard sizes 2×2 and 3×3, for which no solutions exist – their "Queens placed" counts are therefore the total numbers of Queen placements needed to search the entire chessboard. The third exception is the theoretical chessboard size 0×0, upon which zero Queens need to be placed to find the first and only technically valid solution to the problem of arranging 0 non-attacking Queens on a 0×0 chessboard – this is included both for the sake of completeness and for my own amusement.

Also worth mentioning here is the first and only technically valid solution for chessboard size 1×1, which – similarly to 0×0 – comprises just one Queen on the chessboard's single square.

Sources of data

The first solutions for all chessboard sizes that also have accurate Queen placement counts have been generated by a simple program written by my Dad, Colin using C++Builder. This is in fact the latest in a long line of similar programs that he's written to work on this puzzle over the years, beginning way back in 1975 using Assembly language on a big, slow old mainframe computer! The results for all chessboard sizes up to 39×39 have additionally been verified using a program I wrote independently in July 2008 using Turbo Pascal 7.01 (DOS Version); independent verifications by others for the first solutions (but not the Queen placement counts) for our remaining discoveries are credited in the right-hand column of the table.

For all other first solutions on this page (i.e. those with either partial, estimated, or no Queen placement counts), the earliest discovery known to us is again credited in the right-hand column of the table, along with a note stating whether or not we have verified them. And for the first solutions for some chessboard sizes larger than 55×55, please see this paper published on 26th February 2018 by Matteo Fischetti and Domenico Salvagnin of the University of Padua in Italy:

Chasing First Queens by Integer Programming
(with a local copy as backup)

I'm not aware of any further research that extends the list of first solutions beyond the above paper, but I would be very interested to know if any such research is published so that I might include it here.

Patterns in the data

We have found surprisingly few consistent patterns in the numbers of Queens placed whilst seeking the first solutions. As one might expect, there is a general trend for the numbers to increase along with the chessboard sizes, but within this trend the numbers actually fluctuate up and down quite considerably. The only consistent patterns we've identified so far are as follows:

Fascinating facts

Some other details you might find interesting:

Without further ado, here are the results of all our hard work, with the first solutions given in our simple co-ordinate notation. Click on any solution (in the third column of the table) to see it as a chessboard diagram.

Chessboard
size
Queens placed
whilst seeking
the first solution
First solution in
co-ordinate notation
Date of our
first discovery
of this solution
0×0 0 A theoretical but technically valid solution exists
1×1 1 1 Trivial
2×2 6 No solutions exist for this chessboard size
3×3 18 No solutions exist for this chessboard size
4×4 26 2, 4, 1, 3 1975
5×5 15 1, 3, 5, 2, 4 1975
6×6 171 2, 4, 6, 1, 3, 5 1975
7×7 42 1, 3, 5, 7, 2, 4, 6 1975
8×8 876 1, 5, 8, 6, 3, 7, 2, 4 1975
9×9 333 1, 3, 6, 8, 2, 4, 9, 7, 5 No later than 1991
10×10 975 1, 3, 6, 8, 10, 5, 9, 2, 4, 7 No later than 1991
11×11 517 1, 3, 5, 7, 9, 11, 2, 4, 6, 8, 10 No later than 1991
12×12 3,066 1, 3, 5, 8, 10, 12, 6, 11, 2, 7, 9, 4 No later than 1991
13×13 1,365 1, 3, 5, 2, 9, 12, 10, 13, 4, 6, 8, 11, 7 January 1991
14×14 26,495 1, 3, 5, 7, 12, 10, 13, 4, 14, 9, 2, 6, 8, 11 January 1991
15×15 20,280 1, 3, 5, 2, 10, 12, 14, 4, 13, 9, 6, 15, 7, 11, 8 January 1991
16×16 160,712 1, 3, 5, 2, 13, 9, 14, 12, 15, 6, 16, 7, 4, 11, 8, 10 January 1991
17×17 91,222 1, 3, 5, 2, 8, 11, 15, 7, 16, 14, 17, 4, 6, 9, 12, 10, 13 January 1991
18×18 743,229 1, 3, 5, 2, 8, 15, 12, 16, 13, 17, 6, 18, 7, 4, 11, 9, 14, 10 January 1991
19×19 48,184 1, 3, 5, 2, 4, 9, 13, 15, 17, 19, 7, 16, 18, 11, 6, 8, 10, 12, 14 January 1991
20×20 3,992,510 1, 3, 5, 2, 4, 13, 15, 12, 18, 20, 17, 9, 16, 19, 8, 10, 7, 14, 6, 11 January 1991
21×21 179,592 1, 3, 5, 2, 4, 9, 11, 15, 21, 18, 20, 17, 19, 7, 12, 10, 8, 6, 14, 16, 13 January 1991
22×22 38,217,905 1, 3, 5, 2, 4, 10, 14, 17, 20, 13, 19, 22, 18, 8, 21, 12, 9, 6, 16, 7, 11, 15 January 1991
23×23 584,591 1, 3, 5, 2, 4, 9, 11, 13, 18, 20, 22, 19, 21, 10, 8, 6, 23, 7, 16, 12, 15, 17, 14 January 1991
24×24 9,878,316 1, 3, 5, 2, 4, 9, 11, 14, 18, 22, 19, 23, 20, 24, 10, 21, 6, 8, 12, 16, 13, 7, 17, 15 January 1991
25×25 1,216,775 1, 3, 5, 2, 4, 9, 11, 13, 15, 19, 21, 24, 20, 25, 23, 6, 8, 10, 7, 14, 16, 18, 12, 17, 22 January 1991
26×26 10,339,849 1, 3, 5, 2, 4, 9, 11, 13, 15, 21, 23, 25, 20, 22, 24, 26, 10, 7, 16, 12, 8, 6, 18, 14, 19, 17 January 1991
27×27 12,263,400 1, 3, 5, 2, 4, 9, 11, 13, 15, 17, 19, 23, 25, 27, 24, 26, 6, 10, 7, 16, 8, 12, 14, 21, 18, 20, 22 January 1991
28×28 84,175,966 1, 3, 5, 2, 4, 9, 11, 13, 15, 17, 23, 25, 22, 28, 26, 24, 27, 7, 12, 16, 18, 8, 10, 14, 20, 6, 21, 19 January 1991
29×29 44,434,525 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 20, 24, 26, 21, 29, 27, 25, 28, 8, 12, 7, 16, 10, 17, 22, 14, 18, 23, 19 January 1991
30×30 1,692,888,135 1, 3, 5, 2, 4, 9, 11, 13, 15, 7, 23, 26, 28, 25, 22, 24, 30, 27, 29, 16, 12, 10, 8, 6, 18, 20, 17, 14, 21, 19 January 1991
31×31 408,773,285 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 18, 23, 26, 28, 31, 25, 27, 30, 7, 17, 29, 14, 10, 8, 20, 12, 16, 19, 22, 24, 21 January 1991
32×32 2,799,725,104 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 18, 24, 26, 30, 25, 31, 28, 32, 27, 29, 16, 19, 10, 8, 17, 12, 21, 7, 14, 23, 20, 22 No later than 17th May 1997
33×33 4,618,568,460 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 25, 27, 33, 31, 23, 28, 26, 29, 32, 30, 16, 18, 12, 10, 17, 7, 14, 21, 19, 24, 22, 20 No later than 17th May 1997
34×34 78,016,579,095 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 18, 20, 26, 28, 31, 33, 27, 29, 34, 32, 30, 12, 10, 7, 16, 19, 8, 22, 14, 25, 17, 24, 21, 23 28th July 2008
(verified and corrected)
35×35 8,244,234,495 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 24, 26, 31, 29, 32, 35, 33, 28, 30, 17, 7, 34, 10, 18, 16, 14, 12, 20, 25, 23, 21, 27, 22 7th February 1998
36×36 883,134,227,754 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 22, 27, 32, 30, 33, 24, 29, 35, 28, 34, 31, 14, 36, 17, 12, 16, 7, 10, 20, 25, 19, 26, 18, 23, 21 11th February 2002
37×37 37,481,487,475 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 21, 23, 30, 34, 29, 35, 33, 31, 37, 32, 36, 16, 7, 10, 20, 14, 12, 18, 26, 17, 22, 28, 25, 27, 24 7th February 1998
38×38 605,847,021,365 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 21, 29, 31, 33, 36, 30, 28, 38, 34, 32, 37, 35, 20, 18, 12, 14, 23, 7, 10, 25, 17, 22, 16, 26, 24, 27 9th February 2002
39×39 444,710,580,405 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 25, 30, 37, 33, 28, 32, 38, 35, 39, 31, 36, 34, 21, 17, 20, 14, 12, 10, 23, 16, 18, 22, 29, 26, 24, 27 12th December 2001
40×40 18,325,192,478,100 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 21, 23, 30, 32, 34, 36, 38, 40, 31, 33, 35, 37, 39, 20, 22, 14, 18, 10, 12, 24, 17, 7, 28, 26, 16, 29, 27, 25 13th August 2008
(re-run by us and corrected)
Verified before 24th July 2011
by Wolfram Schubert
41×41 670,447,199,438 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 25, 30, 32, 37, 39, 33, 38, 40, 34, 36, 41, 35, 18, 23, 10, 12, 16, 20, 17, 14, 21, 28, 26, 31, 29, 27, 24 15th February 2002
Verified before 24th July 2011
by Wolfram Schubert
42×42 1,435,630,462,823,151 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 21, 23, 25, 32, 34, 36, 38, 40, 42, 33, 35, 37, 39, 41, 16, 7, 24, 20, 14, 17, 26, 10, 12, 30, 28, 18, 31, 22, 27, 29 8th March 2008
Verified before 24th July 2011
by Wolfram Schubert
43×43 9,387,957,604,049 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 24, 26, 37, 39, 34, 38, 35, 33, 42, 36, 41, 43, 40, 20, 14, 17, 10, 12, 28, 18, 16, 27, 25, 21, 32, 30, 23, 31, 29 26th March 2002
Verified before 24th July 2011
by Wolfram Schubert
44×44 168,220,196,252,658 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 24, 32, 35, 38, 41, 33, 42, 37, 34, 43, 39, 36, 44, 40, 21, 25, 18, 14, 12, 20, 16, 29, 10, 23, 27, 30, 17, 31, 26, 28 15th November 2004
Verified before 24th July 2011
by Wolfram Schubert
45×45 151,162,963,331,040 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 29, 31, 36, 40, 42, 32, 38, 43, 39, 44, 35, 37, 45, 41, 21, 18, 24, 14, 12, 23, 16, 20, 17, 28, 25, 34, 26, 33, 30, 27 14th July 2005
Verified before 24th July 2011
by Wolfram Schubert
46×46 Estimated 8,000,000,000,000,000
Find out more about
My Estimate for 46×46
1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 24, 26, 34, 37, 39, 41, 36, 44, 46, 35, 43, 38, 40, 42, 45, 23, 21, 16, 14, 10, 27, 18, 12, 25, 17, 20, 30, 33, 29, 32, 28, 31 30th April 2011 by Matthias R Engelhardt
Verified by us 4th July 2011
47×47 351,874,509,051,227 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 29, 36, 39, 42, 44, 33, 38, 43, 46, 40, 37, 41, 45, 47, 21, 17, 24, 26, 12, 14, 16, 18, 20, 23, 34, 28, 30, 32, 27, 35, 31 9th January 2008
Verified before 24th July 2011
by Wolfram Schubert
48×48 More than 1,971,255,629,167,176
as of 15th March 2012
1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 24, 26, 28, 36, 38, 40, 37, 44, 47, 45, 48, 39, 41, 43, 46, 42, 10, 16, 20, 25, 12, 31, 27, 14, 17, 23, 21, 34, 18, 30, 33, 35, 32, 29 Before 17th October 2011
by Wolfram Schubert
Not verified by us
49×49 192,114,366,691,401 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 37, 40, 45, 41, 44, 38, 48, 39, 49, 43, 46, 42, 47, 16, 12, 24, 20, 28, 17, 14, 30, 21, 18, 35, 31, 26, 23, 33, 36, 34, 32 6th June 2008
Verified before 24th July 2011
by Wolfram Schubert
50×50 More than 391,462,342,338,845
as of 2nd July 2011
1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 36, 38, 40, 45, 43, 48, 46, 39, 37, 50, 41, 44, 42, 47, 49, 20, 18, 24, 26, 30, 12, 16, 21, 17, 14, 31, 35, 23, 29, 33, 28, 34, 32 Before 17th October 2011
by Wolfram Schubert
Not verified by us
51×51 More than 155,115,208,916,103
as of 24th July 2014
1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 31, 39, 41, 43, 40, 47, 50, 48, 51, 42, 44, 46, 49, 45, 16, 26, 23, 12, 30, 18, 14, 17, 20, 24, 21, 28, 34, 36, 38, 33, 35, 37, 32 Before 24th July 2011
by Wolfram Schubert
Not verified by us
52×52 Not counted or estimated 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 38, 40, 42, 46, 39, 50, 48, 51, 45, 43, 41, 52, 44, 49, 47, 21, 26, 28, 30, 18, 14, 12, 17, 23, 16, 32, 24, 20, 31, 37, 34, 36, 33, 35 Before 2nd July 2012
by Wolfram Schubert
Not verified by us
53×53 Not counted or estimated 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 31, 33, 41, 43, 45, 42, 49, 52, 50, 53, 44, 46, 48, 51, 47, 12, 14, 24, 17, 21, 28, 30, 34, 16, 18, 20, 26, 23, 38, 40, 35, 32, 36, 39, 37 Before 24th July 2011
by Wolfram Schubert
Not verified by us
54×54 Not counted or estimated 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 31, 40, 42, 44, 41, 49, 51, 53, 43, 52, 48, 45, 54, 46, 50, 47, 14, 18, 30, 21, 26, 32, 17, 20, 28, 12, 16, 23, 37, 34, 38, 24, 39, 36, 33, 35 Before 2nd July 2012
by Wolfram Schubert
Not verified by us
55×55 Not counted or estimated 1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, 27, 29, 31, 12, 41, 43, 46, 50, 47, 45, 54, 42, 53, 55, 44, 48, 51, 49, 52, 23, 14, 28, 17, 33, 20, 16, 34, 24, 18, 21, 32, 30, 37, 26, 40, 36, 39, 35, 38 Before 24th July 2011
by Wolfram Schubert
Not verified by us

As can be seen from the second column, we had continued searching for the first solutions to chessboard sizes 48×48, 50×50 and 51×51 even after Wolfram Schubert had discovered them, primarily because we were still interested in the numbers of Queens placed to reach them. However, eventually we did stop searching those three chessboards, and the partial counts of Queens placed in the table are the highest and most recent values from our research archive. Our progress on each of these chessboards can be summarised as follows:

48×48
The Queen on Row 15 ("Q15") was sitting in Column 10 when we stopped searching, with Q16 just over half-way across the board in Column 25. Q15's next available safe square would be in Column 24, which is where she would remain for the first solution; Q16 would then need to reach Column 26, which again would be swift as it would be her first safe square. It's therefore possible that this chessboard size would have completed its search within a reasonable timescale.
50×50
Here we had Q18 sitting in Column 29 with Q19 nearly two-thirds of the way across the board in Column 32. For the first solution Q18 needed to be in Column 36, and as every square between Columns 29 and 36 was safe, it probably would have taken her a long time to get there. Q19 similarly needed to be in Column 38 which also followed a long run of safe squares, thereby further slowing Q18's rate of progress.
51×51
On this chessboard Q20 was the next Queen that needed to reach her "first solution" destination. We had her in Column 34, just five safe squares away from where she needed to be in Column 39, which coincidentally Q21 currently occupied. As this is an odd-numbered chessboard it would probably have required fewer Queens to be placed than its even-numbered neighbour 50×50, and so this search might have finished second of the three, but still after a considerable length of time.

While we may return to this project in the future to continue counting the numbers of Queens placed for one or more of these chessboard sizes, without a significant investment of time and processing power it's unlikely we'd ever be able to fill the gap that is the 46×46 chessboard, so our dataset would always remain incomplete. As things stand, we have a continuous set of counts up to 45×45 – for many of which we were also the first to discover the first possible solution – and that in itself is a significant achievement.