Factorial write in ruby (recursive and in loops)