R Two Condition While Loop Not Working Stack Overflow

R Two Condition While Loop Not Working Stack Overflow