Mmmh, since 4178 is even, it clearly cannot be prime.
The largest prime I had to consider was 2 as a divisor, and since 4178 is divisible by 2, it is not a prime
what is the greatest prime you must consider to test whether 4178 is a prime?
2 answers
the greatest possible factor of N is √N.
If there is a factor bigger than √N, then it means there is another less than √N. But if you've tried all the primes up to √N, you'd already have found it.
So, find the largest prime less than √4178 = 64.6
That would be 61
If there is a factor bigger than √N, then it means there is another less than √N. But if you've tried all the primes up to √N, you'd already have found it.
So, find the largest prime less than √4178 = 64.6
That would be 61