in reply to Re^6: OT: Finding Factor Closest To Square Root
in thread OT: Finding Factor Closest To Square Root

It seems to work well as far as I can verify it, with one exception. Like one of my other attempts, if N is prime, it produces N as the nearest factor rather than 1.

However, being recursive, it suffers in performance one you really start making it work.

Try 8585937356. I get a nearest factor of 4 with my dumb crunch code. I gave up waiting for your's :)


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
  • Comment on Re^7: OT: Finding Factor Closest To Square Root

Replies are listed 'Best First'.
Re^8: OT: Finding Factor Closest To Square Root
by Roy Johnson (Monsignor) on Feb 20, 2005 at 13:54 UTC
    When I plug in 1 and 5 as factors, I get 1. Does your factor list include 1?

    Caution: Contents may have been coded under pressure.

      The list produced by M::B::F doesn't include 1.