[math-fun] Add or subtract the nearest square