Gives a magic square that is a product of two magic squares.
Usage
magic.product(a, b, mat=NULL)
magic.product.fast(a, b)
Arguments
a
First magic square; if a is an integer, use magic(a).
b
as above
mat
Matrix, of same size as a, of integers treated as
modulo 8. Default value of NULL equivalent to passing
a*0. Each number from 0-7 corresponds to one of the 8
squares which have the same Fr'{e}nicle's st
Details
Function magic.product.fast() does not take a mat
argument, and is equivalent to magic.product() with mat
taking the default value of NULL. The improvement in speed is
doubtful unless order(a)$\gg$order(b), in which
case there appears to be a substantial saving.
References
William H. Benson and Oswald Jacoby. New recreations with magic
squares, Dover 1976 (and that paper in JRM)