I am trying to create a recursive function as follows.
The function takes a counter
and as long that the counter is larger than zero I would like to call it recursively so that in the end I end up with something like this:
result = 2(2(2n+1)+1)+1
where the last n (when k=0) should be zero.
int pass(int k, int n)
n = 0;
return pass(k, 2*n+1);
Can someone give me a hint as on how to do it?