Dr Rick,

In your program that implements Moler's algorithm in the SAS/IML language, the computation for the Magic2 function constructs a block matrix of size 2n from a magic square of size n, as you said it. Don’t you think that the amount of time needed when n is big (n > 100) can be reduced if a well-defined function f(i, j) is stored for any variable n? Don’t you think that this renders the generation of magic squares more straight?

Contact me if necessary, I mean if you are in search of such a function.

Best wishes
Bay Ima