Question 1172321
.



            Edwin provided a brilliant starting idea in his post.


            I came to complete/(to fix)  his solution accurately.




If the operation was repeated  39  times,  then the  SINGLE  number which left on the board,  is   820 - 39.


After the  39-th step/operation,  there is  NOTHING  to do;  the algorithm does not work further, 
and the  40-th step can not be done  (and is not assumed to be done).



So, &nbsp;the final number is &nbsp;&nbsp;820-39 = 781. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<U>ANSWER</U>