document.write( "Question 1207226: 3-digit number to be the
\n" ); document.write( "largest prime number less than 1000. What is this
\n" ); document.write( "number?
\n" ); document.write( "

Algebra.Com's Answer #844984 by greenestamps(13203)\"\" \"About 
You can put this solution on YOUR website!


\n" ); document.write( "Let's suppose this question is on a timed test, where you can't look at a list of primes on the internet. Then your task is to consider odd numbers close to 1000 and test to see if the number is divisible by any smaller prime numbers.

\n" ); document.write( "A possible (but not absolutely necessary) first step is to note that the square root of 1000 is between 31 and 32, so 31 is the largest prime you will need to check. So the prime numbers we need to look at are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31.

\n" ); document.write( "Note that when we are performing calculations to see if our number is divisible by a smaller prime, we are not looking for the quotient -- we are only testing for divisibility. We don't want to do actual long division; that is too slow.

\n" ); document.write( "When we are testing to see if our large odd 3-digit integer n is divisible by a prime p, there are two steps we can perform (repeatedly, if necessary) to make it faster and easier to check for divisibility:
\n" ); document.write( "(1) Add or subtract any multiple of p to n. If n is divisible by p, then n plus or minus any multiple of p will be divisible by p
\n" ); document.write( "(2) Knock off any trailing zeros. If 10 times a number is divisible by p, then the number is divisible by p.

\n" ); document.write( "So to test for divisibility by p, we add or subtract a multiple of p to our number so that the new number has a trailing zero, and then we knock off that trailing zero.

\n" ); document.write( "Let's use this process to find the largest 3-digit prime number.

\n" ); document.write( "999 is clearly not prime, because it is divisible by 3. So next we look at 997.

\n" ); document.write( "See if 997 is divisible by 7: subtract 7 from 997 to get 990 and knock off the trailing 0 to get 99. 99 is not divisible by 7, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 11: Add 33 to 997 to get 1030 and knock off the trailing 0 to get 103. 103 is not divisible by 11, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 13: Add 13 to 997 to get 1010 and knock off the trailing 0 to get 101. 101 is not divisible by 13, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 17: Subtract 17 from 997 to get 980 and knock off the trailing 0 to get 98. 98 is not divisible by 17, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 23: Add 23 to 997 to get 1020 and knock off the trailing 0 to get 102. 102 is not divisible by 23, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 29: Subtract 3 times 29 (=87) from 997 to get 910 and knock off the trailing 0 to get 91. 91 is not divisible by 29, so neither is 997.

\n" ); document.write( "See if 997 is divisible by 31: Add 3 times 31 (=93) to 997 to get 1090 and knock off the trailing 0 to get 109. 109 is not divisible by 31, so neither is 997.

\n" ); document.write( "We have tested 997 for divisibility by all the primes less than or equal to 31 and found that 997 is not divisible by any of them. That means 997 is prime.

\n" ); document.write( "ANSWER: 997

\n" ); document.write( "That looks like a lot of work; but it is not too bad if your mental arithmetic is good.
\n" ); document.write( "
\n" );