These versions of trial division are guaranteed to find a factor of "n" if there is one since they check "all possible factors" of "n" - and if "n" is a prime number, this means trial factors all the way up to "n".