Factorial and tower of hanoi