num = 10000
steps = 0
objective = input("Introduce number of steps")
while steps < int(objective):
if (num / 3).is_integer():
num = num - 1
if num / 3 == 2:
num = num - 2
if num / 3 == 1:
num = num + 2
steps = steps + 1
print(num)
the problem is that it doesn't output any correct answers
im trying to write a program to solve this problem i found today in a math olympiad:
Clara changes a number N written to the board following the following rule: If N is multiple of 3, then Clara decreases one unit; if the remainder of dividing N by 3 is 2, then Clara decreases 2 units; if the remainder of dividing N by 3 is 1, then Clara increases 2 units. Clara starts with the number 10 000. What number will she have obtained after 2020 steps?
and these are the possible answers:A) 886 B) 6977 C) 6974 D) 6975 E) 919
btw i was supposed to solve these with just paper and pencil so if someone knows how i was supposed to actally do it it'd be interesting