02:23 pm, 12 Sep 06

### eight queens boggler

Last year a friend from work posted a link to her site, which explains their logo:

Our logo shows a solution to the famous eight queens problem:Your task: how does that work?

How do you place eight queens on a chessboard so that none can capture any other?

To arrive at this solution you can compute (2^{8}- 1) / (8 - 1) which equals 255 / 7 which equals (rounded to 6 decimals) 36.428571

The eight digits making up that number are the numbers of the rows in which to place 8 successive queens.

avvawetzelavvaOf simple repeating fractions of the kind 1/i for i small, only 1/7 is remotely varied enough to make it a candidate. Its period is, famously, 142857. The reason it satisfies the diagonal conditions is.... umm... actually it doesn't! If we use it as is, row 1 will attack row 5. But we have a leeway of rotating the period as we go through fractions 1/7, 2/7....6/7. Maybe one of them will turn out lucky because rotation will break up the diagonal attacks. So we try: 142857 and 714285 won't work because of 1-5, 428571, 285741, 857142, 571428 all look OK, and these correspond to periods of 2/7, 3/7, 4/7 and 5/7. We also need to add 3 and 6 somewhere, because 1/7 only has 6 of the 8 rows, so let's try to put them at the beginning: either 36 or 63, and see that the diagonal condition is not messed up. It is in some cases: 63 will fail with 428571, 285741 and

857142. 36 will fail with 571428 and 857412 (3-7) and 285741 (6-8). So only two valid numbers are left:

36.428571

63.571428

multiply them back by 7, and it's 255 and 445. Woo-hoo! 255 is special so we can prettify it as 2^8-1. The fact that it's the same 8 as in 7=8-1 is incidental.

By the way, what's 445? It's 444+1, which is... er... 7+1 repeated thrice, halved, add 1 again and divide by 7! No, nearly not as impressive, but the queens are just as fine.

So basically I'd say we're looking at guesswork with lucked out, because it doesn't seem like the diagonal condition is somehow deeply connected to the fractional periods, and it's just a matter of luck to try and rotate them the right way, plus add some more numbers in front which don't violate it.

But I may be missing out on a deeper reason. Am I?

gaalnqueens anywhere?^{2}gaalflipzaggingIt also works with 35 5/7. With rounding that's 35.714286.

Nifty ways to write that: 250/7, 1000/4/7. If we allow 3.5714286, it's also 25/(2+5), or (5**2)/(5+2).

avva