Algorithm for generation of Canonical represented integers Is there a way to get canonical representation of an integer by algorithm?
I can get primes, but I don't know how to represent, for example, 1000 as 2^3×5^3. How can I compute the power of each prime number?
The simplest algorithm to do this is to divide repeatedly by the prime, until the division no longer yields an integer.