Bash + GNU utilities, 5849
- 9 bytes saved thanks to @Cowsquack
factor|sed -r 's'/.:$/c-1/ s/.*: \w+$/1/c1 s%: %/% sy/ .*/#/'|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:s/.:$/c-1/The input numbers 0 and 1 have no prime factors and are replaced with-1s/.*: \w+$/1/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 factorsy/ .*/#/Remove the list of other (unneeded) factors (by commenting out)
bcArithmetically evaluate and display