How many satisfy ? We must have and . Let . Then we must have divisible by 12. This gives the possible values for , which implies , or 9 mod 13. Similarly, if , must be divisible by 18, which leads to , or 11 mod 19. (we actually found 178 above by solving and The 3 choices mod 13 and mod 19 imply there are 9 with .
How many satisfy ? If , we must have , which leads to , or 17 mod 13. Similarly, we get , or 12 mod 19. Thus we get 9 satisfying this condition.
If we choose at random, the chances of getting an that is not a witness are . If we do the test 5 times, the chance of incorrectly concluding 247 is a prime is .
[We actually did more work than necessary, identifying the exact set of numbers which would lead to a wrong conclusion. If we only want to count how many numbers there are, we could make use of observations such as that, for any , an equation will either have 3 solutions or no solutions.]