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.