Welcome to the Ranch
You have made that loop surprisingly complicated. Why don't you consider that one of the numbers is always two more than the other, so you only need one number in the loop header.
Remember you are dealing with integer arithmetic, so I can predict what the division will produce just by looking.
I can see at least three other problems, but maybe if you correct that one, you will be able to correct the others yourself.