Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prime Factors
#5
thanks Pete, will try it in a while
I found some entries on the Rosetta Code https://rosettacode.org/wiki/Prime_decomposition
I tried the FreeBasic implementation because there's an easy to use GMP header for BigInt and changing the code from integer to BigInt is trivial
but as I was playing with it I found that some integers are easy to factorize while others are hard, for example
factor(314159265358979323846264338327950288419716939937510582097) took less than a second, but
factor(31415926535897932384626433832795028841971693993751058209749) is still running
even the pari/gp calculator took 1.6 seconds
by the way, the factors for the last one are 3, 37, 65665363877655791, 4310131680920695304618177764671198362549
Reply


Messages In This Thread
Prime Factors - by SMcNeill - 05-18-2024, 03:32 AM
RE: Prime Factors - by PhilOfPerth - 05-18-2024, 03:59 AM
RE: Prime Factors - by Jack - 09-21-2024, 10:39 PM
RE: Prime Factors - by Pete - 09-21-2024, 11:15 PM
RE: Prime Factors - by Jack - 09-22-2024, 12:00 AM
RE: Prime Factors - by SMcNeill - 09-22-2024, 12:30 AM
RE: Prime Factors - by Jack - 09-22-2024, 12:46 AM
RE: Prime Factors - by eoredson - 09-30-2024, 04:36 AM
RE: Prime Factors - by Jack - 09-30-2024, 10:59 AM
RE: Prime Factors - by SMcNeill - 09-30-2024, 12:03 PM
RE: Prime Factors - by Jack - 09-30-2024, 12:15 PM
RE: Prime Factors - by Jack - 09-30-2024, 08:42 PM
RE: Prime Factors - by SMcNeill - 09-30-2024, 11:44 PM
RE: Prime Factors - by Jack - 10-01-2024, 01:07 AM
RE: Prime Factors - by eoredson - 10-02-2024, 05:05 AM
RE: Prime Factors - by SMcNeill - 10-02-2024, 06:07 AM



Users browsing this thread: 5 Guest(s)