Factorial using range