Do it brute force, entering all positive integers n in order until reaching 13 (n=3, remainder 2, n=4, remainder 0, etc.). All numbers 'n' greater than or equal to 13 will have a remainder of 16, so when discarding the two remainders that repeat (2 and 0) the answer is 9.