TowersOfHanoi recursive solution formula