Exercise 555Number theory › PrimesHigh schoolAdded 3 Nov 2026
Trial division primality test
#trial division#primality test#algorithm
Statement
Test whether is prime using trial division.
Hint
Test divisibility by primes up to .
Show solutionHide solution
Solution
Primes to test. .
Divisibility.
- : odd, no.
- : , not divisible by .
- : ends in , no.
- : , no.
- : alternating sum , not , no.
Conclusion. is prime.