http://www.perlmonks.org?node_id=432558

QM has asked for the wisdom of the Perl Monks concerning the following question:

Given N, and a list of prime factors of N's prime factorization (a list) from Math::Big::Factor::factors_wheel(), I need to find a (possibly composite) (integer) factor near the square root of N.

Is there a nice dynamic programming routine to get reasonably close?

Update:: clarified what Math::Big::Factor::factors_wheel() returns.

Update: Finding the nearest factor less than or equal to the square root, or even it's prime factorization, is sufficient for my needs, and may speed up the search in some cases. (Though the more general problem of "finding the factor nearest the square root, on either side" might be interesting too.)

-QM
--
Quantum Mechanics: The dreams stuff is made of