output every x iterations of m and n