InterviewSolution
Saved Bookmarks
| 1. |
Determine the largest prime number that you need to test as a divisor to find whether or not 397 is aprime number |
|
Answer» n=397 ;square root of 397 < square root of 400 =20 So I would check if primes less than 20 divide 397, ie 19,17,13,11,7,5,3 and 2. On the first glance we can exclude 2,3,5 as 397 is not even, not ending with 5 nor sum of its digits is not divisible by 3. The other candidates left combined in pairs and multiplied are less than 397 or triplets and multiplied surpass 397, except 7^3 <350<397 That means there is no factorization of 397, so 397 is prime number. |
|