magic.product | R Documentation |
Gives a magic square that is a product of two magic squares.
magic.product(a, b, mat=NULL) magic.product.fast(a, b)
a |
First magic square; if |
b |
as above |
mat |
Matrix, of same size as |
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)
>>order(b)
, in which
case there appears to be a substantial saving.
Robin K. S. Hankin
William H. Benson and Oswald Jacoby. New recreations with magic squares, Dover 1976 (and that paper in JRM)
magic.product(magic(3),magic(4)) magic.product(3,4) mat <- matrix(0,3,3) a <- magic.product(3,4,mat=mat) mat[1,1] <- 1 b <- magic.product(3,4,mat=mat) a==b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.