lozenge                package:magic                R Documentation

_C_o_n_w_a_y'_s _l_o_z_e_n_g_e _a_l_g_o_r_i_t_h_m _f_o_r _m_a_g_i_c _s_q_u_a_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Uses John Conway's lozenge algorithm to produce magic squares of
     odd order.

_U_s_a_g_e:

     lozenge(m)

_A_r_g_u_m_e_n_t_s:

       m: magic square returned is of order 'n=2m+1'

_A_u_t_h_o_r(_s):

     Robin Hankin

_S_e_e _A_l_s_o:

     'magic.4np2'

_E_x_a_m_p_l_e_s:

     lozenge(4)
     all(sapply(1:10,function(n){is.magic(lozenge(n))}))

