text: 997 is correct.  Start at 999 and go backwards.  \n999 is divisible by 3\n998 is divisible by 2\n997 is prime, because it's not divisible by 2,3,5,7,11,13,17,19,23,29,31, or 37.  We only have to check up to 37 because 37 * 37 = 1369, which is bigger than a 3 digit number.  If a prime number bigger than 37 would divide into 997, then the quotient would be less than 37, and that quotient would divide 997, but we checked and no numbers less than 37 divide 997, do 997 is prime.\n\nThat is known as the "sieve of eratosthenes".