
Patrick B. answered 03/15/19
Math and computer tutor/teacher
Typically the half way point is the cut-off. If you do not find a prime divisor by then, there are none.
Since your bound is already lower than that, it is optimized
\\frac{2L}{2}$, or, $2P > L$. Similarly if $\\frac{L}{3}
L$, and I've already checked that $2$ is not a factor of $L$, so $2P ≠ L$. You could make this same argument for $\\frac{L}{5}, \\frac{L}{7}, \\frac{L}{11}$, etc. In other words, I don't need to check every prime number, I just need to check every prime number up to the point where $\\frac{L}{P_{n}} < P_{n}$, ($P_{n}$ is the nth prime number) because, at that point, all primes before $P_{n}$ have been ruled out, and since $P_{n} > \\frac{L}{P_{n}}$ then $(P_{n})^2 > L$, thus $P_{n}$ is not a factor of $L$. Also, if $P_{n} > \\frac{L}{P_{n}}$ then $P_{n + 1} > \\frac{L}{P_{n + 1}}$, because $P_{n + 1} > P_{n}$, this same reasoning rules out all larger primes. So, for example, when trying to find a prime factor of $607$, rather than checking every prime number less than $607$, I only need to check the first $10$ primes up to $29$, because $\\frac{607}{29} < 29$. If the first $10$ primes are not factors of $607$, then $607$ has no prime factors and must be prime. Is my reasoning valid, and, is it possible to reduce the number of primes you'd need to check even more?
Patrick B. answered 03/15/19
Math and computer tutor/teacher
Typically the half way point is the cut-off. If you do not find a prime divisor by then, there are none.
Since your bound is already lower than that, it is optimized
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.