Because 397 < 400, we check whether 397 is divisible by any prime number less than 20.
The prime numbers less than 20 are 2, 3, 5, 7, 11, 13, 17, 19.
Let us test the divisibility of 397 by each of them.
397 is not divisible by 2 because the digit in the ones place is odd.
397 is not divisible by 3 because 3 + 9 + 7 = 19, but 19 is not divisible by 3.
397 is not divisible by 5 because the digit in the ones place is neither 5 nor 0.
397 is not divisible by 7 because 3977 gives quotient 56 and remainder 5.
397 is not divisible by 11 because the difference of the sums of the digits at the alternate places is 1 which is not divisible by 11.
Now 397 is not divisible by 13 because 39713 gives quotient 30 and remainder 7.
397 is not divisible by 17 because 39717 gives quotient 23 and remainder 6.
397 is not divisible by 19 because 39719 gives quotient 20 and remainder 17.
Since 397 is not divisible by any prime number less than 20, so 397 is a prime number.