Ulam Spiral in Java