Wikipedia has a good list of factoring algorithms: http://en.wikipedia.org/wiki/Integer_factorization#Factoring_algorithms
Your second approach effectively uses a sieve and has the good ability to quickly reduce the problem when N is a multiple of a majority number. The code can be improved by looping over primes, and not all possible divisors for 2..sqrt (n).
Alternatively, you can start with the primality test so that you know that N is composite before you do additional work.
Your note says that you do not factor N, but the problems are related. The search for F and R reduces to studying disjoint combinations of prime factors N.
In the case N==36 simple factorization of N is 2, 2, 3, 3 . Factors F and R must include all of these (so that F*R==N ) and there can be no overlap (so GCD(F,R)==1 ). So 4 and 9 appear immediately.
A more instructive example might be N==23256 . Its factorization is 2,2,2,3,3,17,19 . Since there can be no overlap between F and R, each main base can only go into one of two buckets (i.e. you get either all two or none of them). So we can group factors into 8,9,17,19 . To find R, we want the combination of these factors to be as large as possible, but below 152.49, the square root of 23256. Our options are {8}, {9}, {8.9}, {8.17}, {8, 19}. The largest of them is 8*19 , equal to 152. The corresponding F is 17*19 or 153.
The choices above are calculated as [choice for choice in powerset([8,9,17,19]) if prod(choice) < math.sqrt(N)] .
Thus, the entire program is largely reduced to the following:
prime_factors = factorize(N) # [2,2,2,3,3,17,19] clusters = [p**e for p, e in collections.Counter(prime_factors).items()] # [8,9,17,19] R = max(prod(group) for group in powerset(clusters) if prod(group) < math.sqrt(N)) F = N
A powerset search can be done faster by trimming the generation of sets when they exceed the square root of N.
Keep in mind that factorization is an expensive computer, and power plants grow very quickly, but probably much less than the original algorithm, which performs many divisions, starting from the square root of N and running down.