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

Roy Johnson,
What am I missing - it still produces 77951 as the answer?

Cheers - L~R

  • Comment on Re^4: OT: Finding Factor Closest To Square Root

Replies are listed 'Best First'.
Re^5: OT: Finding Factor Closest To Square Root
by Roy Johnson (Monsignor) on Feb 28, 2005 at 19:16 UTC
    I fixed a different bug and re-broke this! Ok, it's updated and works at least for your example. Gotta update my benchmark code, too.

    Caution: Contents may have been coded under pressure.
      Roy Johnson,
      Ok, now it is broken for 26816652079 which has a prime factorization of (7,19,109,691,2677). The correct answer should be 91903.

      Cheers - L~R

      Update:Impressive! After your last updated, not only does it now get all 50_000 answers correct - it is within a few seconds of my Inline::C solution. A proper benchmark might find it faster.