powered by
TRUE
sum(vec)==magic.constant(n,d=d))
is.ok(vec, n=length(vec), d=2)
vec
is.ok(magic(5)[1,])
Run the code above in your browser using DataLab