by **Red Ed** » Sun Jun 19, 2005 8:17 pm

This one ought to yield to brute force. Like this, for example:

1. we may as well assume that the leading diagonal contains 1...9 in that order. Then we'll count the number of solutions and multiply the result by 9! = 362880 to get the final answer.

2. given 1...9 down the leading diagonal, there are 4752 ways of placing 1...9 in some order down the other diagonal to make an X shape. Given any such X shape, it's easy to have a computer enumerate all possible completions of the grid. But doing that 4752 times is too expensive, so ...

3. we split the 4752 X shapes into equivalence classes. Two X shapes are equivalent if you can transform one into the other by rotating, transposing and permuting the rols/cols of the grid. This is standard stuff by now! In this case, I think we end up with 74 equivalence classes (to be confirmed ...).

4. so now you just do 74 (or however many it is) calculations, one per representative X shape, and add up the results.

I'll set this going overnight. Hopefully have an answer by the morning.