Math 2.0

concept

Trial division

Summary

Trial division is the simplest method to factor an integer n>1n > 1 or to test whether it is prime. It divides nn by the integers d=2,3,4,…d = 2, 3, 4, \dots in turn, and it stops at the first dd that divides nn, or when d2>nd^2 > n. If no dd with d2≤nd^2 \le n divides nn, then nn is prime.

Remarks

The method is correct because a composite number has a prime factor at most its square root. It is enough to test the primes dd, but a test of all integers dd is also correct. For a number nn with kk digits, the method can need about n≈10k/2\sqrt{n} \approx 10^{k/2} divisions. Thus it is slow for large nn.

Explanations

L1 human

To test whether 9191 is prime, try to divide it by 22, 33, 55 and 77. You can stop after 99, because 102>9110^2 > 91. The division by 77 works: 91=7⋅1391 = 7 \cdot 13. So 9191 is not prime.

What this node needs for W2
  • edge defines in: at least one definition (0 of 1)
  • edge instance_of in: at least two examples (0 of 2)
  • edge not_instance_of in: at least one non-example (0 of 1)
  • edge specializes both: the more general notions and the special cases (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

Sources

  1. Web https://en.wikipedia.org/wiki/Trial_division, Method