How many primes do I need to check to confirm that an integer $L$, is prime?

A composite number is always at least as big as the square of its least prime factor. So if a number is composite, it will have a factor no larger than its square root, as you have shown.

Examples like $289=17 \times 17$ show that you can't do better than this. With different prime factors you can take something like $29\times 31 = 899$ and you can't do better.

The second example - which is not a prime power - depends on primes being close together - although the twin prime conjecture (infinitely many pairs of primes with difference $2$) is still open, there are now known to be infinitely many pairs of primes with small differences.

The claim you quote, that checking three digit numbers to see if they are prime powers is difficult is frankly ludicrous. I can do that fairly efficiently in my head. There are not many prime squares, and beyond that the powers of $2,3,5,7$ are not difficult to identify.


Is my reasoning valid, and, is it possible to reduce the number of primes you'd need to check even more?

Yes, your reasoning is valid. This method of trying to deduce whether a number $N$ is prime by testing for prime factors up to $\sqrt N$ is called trial division.


With trial division it is enough to check up to the square root. In fact, for three-digit numbers, it suffices to check for divisibility up to 31. So if the number ends in 1, 3, 7, or 9 (so you can rule out divisibility by 2 and 5) and the sum of its digits isn’t divisible by 3 (so it isn’t divisible by 3 either) you need only check for 7, 11, 13, 17, 19, 23, 29, and 31. Eight divisions won’t kill you.

It’s no harder to check for prime powers than primes — if you find a prime factor, just check if it divides the number repeatedly until only 1 is left.

I should note that if you’re doing division by hand, there’s no need to compute an explicit square root — if the quotient is less than the divisor, you’re done.