You are testing some positive integer to find out if it is prime.
Assuming the algorithm works for any positive integer what is the smallest value that goes in the blank?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
P / 2 can be disposed of with a counter-example: if P = 9 , 9 / 2 = 1 . 5 . The only value that will be checked is 2, so the algorithm will claim P is prime, but 9 = 3 × 3 .
The next largest value (assuming P > 4 ) is P . A failure would happen if a prime number is declared non-prime. We're going to suppose this happens, and show this leads to a contradiction.
Suppose there is some postive integer A > P that divides P but is not accounted for by the algorithm (that is, we haven't checked integers large enough yet, and the first failure is at A ) . That means there is a postive integer B such that A × B = P . But note that P P = P and A P > P so that for A × B to equal P , B < P . But that means B would be included by the algorithm and P would be declared not prime. Therefore there is no value larger than P not accounted for by the algorithm.