2
$\begingroup$

I am looking for an algorithm which helps me split a number $N$ as such:

$$N=p_1^a p_2^b \cdots p_n^z$$

where $N$ is the given number, $p$ is prime numbers smallest to greatest, and $a,b,\cdots,z$ are the power over the prime.

e.g. $10 = 2^1 \cdot5^1, \quad 20 = 2^2 \cdot5^1$.

  • 0
    You can write decent-looking formulae with the help of $\LaTeX$.2012-10-24

2 Answers 2