Is there an existing formula to find the number of solutions of a magic square?
I know:
3x3
4x4
5x5
..
I'd like to be able to do a nxn.
I can also do the magic number sums.
Any help in the right direction would be greatly appreciated.
Printable View
Is there an existing formula to find the number of solutions of a magic square?
I know:
3x3
4x4
5x5
..
I'd like to be able to do a nxn.
I can also do the magic number sums.
Any help in the right direction would be greatly appreciated.
Hi all.
Take a look at
http://mathworld.wolfram.com/MagicSquare.html
It provides some methods to build magis square nxn.
According to that webpage:
The number of 6×6 squares is not known, but Pinn and Wieczerkowski (1998) estimated it to be (1.7745+/-0.0016)×10^(19) using Monte Carlo simulation and methods from statistical mechanics.
So, I guess this project would be impossible, unless I were to sit down and figure them out myself.
This is one of the unsolved questions in mathematics. If you do happen to find a solution you will join the ranks of great mathematicians. Keep us posted!
Sounds like an intriguing task.
Since there are so many different solutions, would it be better to make the application multi-threaded - and thread several different computations at once? or would it be better to just run it straight forward no threads?
Whether you should multi-thread or not would depend on the hardware you are targeting.
If you are targeting a single-core, non-hyperthreaded processor, you are going to take an extra CPU hit whenever the threads switch.
If you are targeting a single-core, hyperthreaded processor, probably go with just 2 threads.
If you have multiple cores/multiple processors, you can probably scale up accordingly. There are probably some additional tricks you need to do to get your program to run on more than one core. The Multithreading Forum would probably be the place to go to get further advice.