We can even replace 'm * np.arange(m)' with 'np.arrange(0, m**2, m)' to
avoid m multiplications.