Bash + GNU utilities, 49
- 9 bytes saved thanks to @Cowsquack
factor|sed '/:$/c-1 /: \w+$/c1 s%: %/% y/ /#/'|bc ###Explanation
factorreads input numbers from STDIN, one per line and outputs in the format<input number>: <space-separated list of prime factors (ascending)>sedprocesses this as follows:/:$/c-1The input numbers 0 and 1 have no prime factors and are replaced with-1/: \w+$/c1Numbers with one prime factor (themselves) are prime. Replace these with1s%: %/%Replace:with/. This builds an arithmetic expression to divide the (non-prime) input number by its smallest prime factor to give the largest factory/ /#/Remove the list of other (unneeded) factors (by commenting out)
bcArithmetically evaluate and display