Project Euler 872 - Recursive Tree

Official link: https://projecteuler.net/problem=872

Thought Process

After drawing a few trees a few patterns emerge. 

Essentially there are patterns relating to 2^n.

Once you ask yourself the question: What is the parent of node x, then answer becomes clear.

Interactive Code

Input 2 integers separated by a space (n, x)

Code will output f(n, x)