Google Interview Question

Recursion and some bit logic problem