1.2 Trial Division
To test whether is prime you do not have to try every number below it. Test only the PRIMES up to . If then one of and is at most , so if nothing that small divides , nothing larger will either.
- Work out .
- Divide by each prime up to :
- One divides exactly, so is composite. None does, so is prime.
Testing large numbers for primality
For each number below, state whether it is prime or composite, and give your reasoning: (a) 861 (b) 509
- (a) Digit sum of : , divisible by .
- is composite ().
- (b) (to 1 d.p.), so test all primes : .
- is odd (not div. by 2), digit sum (not div. by 3), does not end in 0 or 5, and , , , ,
- is prime.
Try it
A practice question on this appears here. Practise primes hcf lcm.
Predict
Is prime? It is odd, its digits add to , and it does not end in or , so it passes the tests for , and .
(to 1 d.p.), so is still on the list of primes to test.
, so is composite.
Stopping at , and is the usual reason a composite number gets called prime.
Practise this
Questions on Primes, HCF and LCM, marked as you go, with the working shown.