+ 2

Factoring numbers program

Hi everybody, I know factoring large numbers is CPU intensive, and factoring products of large primes is incredibly hard. This reason that digital encription work so well. I wrote a python program to factor njumbers, factor2a.py. give a number n, I only need to look for factors equile to or less than the squarerrot of n. this helps alot, but is there any other tricks I can do to speed up my factorng roujtine??? factor2a.py https://code.sololearn.com/c8FWx1Uu60E6/#py

17th Apr 2018, 10:00 PM
Rick Shiffman
Rick Shiffman - avatar
2 Antworten
+ 3
Thanks Tony
21st Apr 2018, 5:03 AM
Rick Shiffman
Rick Shiffman - avatar
+ 1
Look into threading or subprocesses, so that your program can utilize more of your computer's cores. Although it complicates how you need to handle data, since you're going to need to have multiple parallel calculations on the same data. Queues and thread locks are the two ways to manage this. I'm not saying it's simple, but it's a solution.
19th Apr 2018, 11:15 AM
Tony K
Tony K - avatar