>>3580
>The decision tree terminates upon finding a factor.
>Pre-factorisation, trim trailing zeros (in binary) or equiv is to divide by two until odd.
>This is 1 and c for primes.
>This is the square root for squares.
>This is the pair of factors that are not 1 and c for the product of two primes that are not the same numbers (not a square).
>This is the pair of factors closest to the square root for products of more than two factors (not including 1 and c as factors).
>>3840
>We know that this function will return a factor, so for a prime number that means it will return either 1 og the prime itself (I'm assuming). This we can also use the function as a primality tester.
Based on VQC quote above, yes it looks like it brings back the two factors closest to sqrt (c). When c is prime you'll get 1 back, and c, so you'll know it's prime.
If your c might have more than two factors, and it spits back out c = ab, you can further put a and b into the algorithm. Like if you put 360 in, you should get: 1820 (not 1036 or anything else). Then 18 = 63 (not 29); 20=45 (not 2*10) etc.