recursion: added robot, factorial, and magic index implementation