Boundary situation is easy, 0 & 1.
So when is the end? Get all factors until left 1. So num = 1 is the end.
Notice there is no sequence between the prime factors. So within each while loop for each prime factor, all the same factor can be divided out.