Recently, I have been required to compute the Prime Factorization of large numbers.
For instance,
$5^9 -1 $
I know that it ends in a $4$, so can be divided by $2$. Then can be divided by $2$ again, but this creates a factor tree which is what I am looking to avoid.
How would I go about prime factorising this?
By my factor tree method I get to $2\times 2\times 19\times 31\times 829$. But I had to type into the internet whether $829$ was a prime, so I immediately run into a problem.
Any help or ideas would be appreciated!
What you are attempting to do is called prime factorization (Yes, that is in the title).
In order to determine if $829$ is a prime number or not, I would use trial division:
By using your factor tree method, you have factored it to $2\times 2\times 19\times 31\times 829$.
At this point, if you are doing it right (test the divisibility of $5^9-1$ starting from the smallest prime number, which is $2$), then the number $829$ is not divisible by any prime numbers from $2$ to $31$. Because $31^2=961>829$, that is enough to show that $829$ is a prime number.