$y=shift; for($i=2;$i<=$y;){ next if$y%$i++; $y/=--$i; push@x,$i } print@{$,=x};