1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Prime factorization for large numbers

  1. Aug 22, 2011 #1
    I need to factorize large numbers (some of them have about 200 decimal digits). Wolfram alpha is a dead end and programming with python is not working for me too. Any suggestions?
  2. jcsd
  3. Aug 23, 2011 #2


    User Avatar
    Science Advisor

  4. Aug 23, 2011 #3
    Oops. Sorry! I did miss a REALLY important thing(!!): they are really so simple/silly! They are full of zeros, for example one of them is 909091 with 150 zeros after it, so the only problem would be factorizing 909091 and that's not a big deal. so the answer of the given number will be 909091*2^150*5^150. There is a list of them (523 numbers) and they are between 100 and 200 digits and most of them are really simple to solve ... But my problem is that I don't want to factorize them myself.

    + I think If I eliminate zeros and then factorize it with current codes, it can be done. but It's a new thing for me and I don't know how to do it properly!
  5. Aug 23, 2011 #4


    User Avatar
    Science Advisor

    Factoring small numbers like that is really just a process of searching through the possible prime factors up to the square root of the number. You can write a code to do it or use existing codes. Why didn't Wolfram Alpha work for you? It did for me. The example you listed is prime. See this link:

  6. Aug 23, 2011 #5
  7. Aug 23, 2011 #6
    I did the damn thing, I just entered the non-zero part in Wolfram and factorize the rest of them myself.

    @Bill Simpson & @phyzguy:
    Of course, if you enter :

    It will give you the answer, but The numbers weren't in this form and there is not enough room for all the zeros to be entered in Wolfram:

    , and second, there was 523 of them and That's why I said I want to eliminate all zeros and write a code for them... Because It was a nightmare to enter them one by one, I wanted to give the .ods to that program and get the answers as fast as possible.... anyways, It's done now! :-)
  8. Aug 24, 2011 #7


    User Avatar
    Science Advisor
    Homework Helper

    if you ever have a real challenge to factor large numbers, write Carl Pomerance and ask him.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook