# Thread: needed code for divisors

1. ## 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.

2. Originally Posted by ssnmanikanta
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