%primeFactors(n) - prime factors of n
function factors = primeFactors(n)
factors = []; 
remaining = n; 
while remaining > 1 %! Condition for continuing
   sf = smallestfactor(remaining);
   factors(end+1) = sf; %! Update accumulator
   remaining = remaining/sf;
end