Solution to factorial digit sum in python