n-factorial working