Update 531.py

more concise if the user is allowed to make the cycle go negative.