Results 1 to 2 of 2

Math Help - needed code for divisors

  1. #1
    Newbie
    Joined
    Nov 2010
    Posts
    11

    needed code for divisors

    As I saw in wolfram website and in pari , if given divisors(x) , it will give all the divisors of x in a row.
    ex: divisors (34567) = { 1, 13, 2659, 34567 }
    So I we know some x = 2^5 * 5^15 * 21^5 * 119 , Here we even know the prime factors
    Then,
    Is there any program in c language (or) any other easily understood computer programing language (so that I could convert into a c program using the same logic , since I know only c language programing) , (or) any easy algorithm to form
    divisors at very fast speeds (because I require to form divisors for very large numbers) .
    If any one have the code please give me , or any step wise explained algorithm is also sufficient.

    Here I can formulate an algorithm by observing the factors of the number (i.e using the arrangement of factors in ascending or descending order), but I think ,this method is too slow to form the divisors for very very large numbers having a lot and lot of divisors in it.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by ssnmanikanta View Post
    As I saw in wolfram website and in pari , if given divisors(x) , it will give all the divisors of x in a row.
    ex: divisors (34567) = { 1, 13, 2659, 34567 }
    So I we know some x = 2^5 * 5^15 * 21^5 * 119 , Here we even know the prime factors
    Then,
    Is there any program in c language (or) any other easily understood computer programing language (so that I could convert into a c program using the same logic , since I know only c language programing) , (or) any easy algorithm to form
    divisors at very fast speeds (because I require to form divisors for very large numbers) .
    If any one have the code please give me , or any step wise explained algorithm is also sufficient.

    Here I can formulate an algorithm by observing the factors of the number (i.e using the arrangement of factors in ascending or descending order), but I think ,this method is too slow to form the divisors for very very large numbers having a lot and lot of divisors in it.
    You seem to be aware of Wolfram Alpha, maybe you should also experiment with a Google search for "fast prime factorization" or "code for fast prime factorization". It will save people here retyping stuff you can get from the horses mouth.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Relitivly prime, unique divisors of divisors
    Posted in the Number Theory Forum
    Replies: 3
    Last Post: November 24th 2010, 08:40 AM
  2. Divisors again
    Posted in the Number Theory Forum
    Replies: 8
    Last Post: November 21st 2010, 10:20 AM
  3. Zero divisors and such
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: April 4th 2010, 07:32 PM
  4. Sum of divisors
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: June 13th 2009, 11:07 AM
  5. Matlab Code Writting Help Needed
    Posted in the Math Software Forum
    Replies: 16
    Last Post: July 30th 2008, 08:38 AM

Search Tags


/mathhelpforum @mathhelpforum