Consider a gambler who has $k$ coins when he enters a casino. The gambler plays a game in which he wins $1$ coin if he wins a round and loses $1$ coin if he loses a round. He wins a round with probability $\displaystyle \frac{1}{2}$ and loses a round with probability $\displaystyle \frac{1}{2}$. The gambler is considered to win the game if he ends with $n$ coins ($n \gt k$) at some point of time and is considered to lose a game if he ends with $0$ coins.
What is the probability that the gambler wins the game on the $m^{th}$ round(where $m\gt n-k$ and $m=n-k+2r $ for some $r\in\Bbb{N}$ ) such that he does not end with $0$ coins or $n$ coins in any of the earlier $m-1$ rounds.
$\color{green}{\text{My try:}}$
Due to a lot of restrictions on the parameters and the event, I tried to work out the problems for some small values of $n,m,k$ to get an idea on how the probability might be. On obtaining some sequences of numbers I tried searching the sequence on OEIS to get an idea over the explicit form for the probability.
But even after trying a lot of values for $n,m,k$ I couldn't conjecture an explicit form for the probability.
If we denote the probability that the gambler wins in the $m^{th} $ round by $p_m$ then I could only conjecture that $$p_m=\displaystyle f_{n,k,m} \left(\frac{1}{2}\right)^{m}$$
For some natural numbers $f_{n,k,m}$ which depend on the values of $n,k,m$. It is quite easily noticeable that $$f_{n,k,n-k}=1$$ but other than this I couldn't find a general pattern for the $f_{n,k,m}$'s.
Any help would be greatly appreciated. Also if it would be possible to create a generating function for $f_{n,k,m}$ then that generating function would also suffice to solve the problem ( I tried to form a generating function for the $f_{n,k,m}$'s but failed miserably).
* Edit *
Some values I tried are ("assuming I have counted them correctly"):
$$f_{6,2,4}=f_{6,3,3}=f_{5,2,3}=f_{6,4,2}=f_{5,1,4}=1$$ $$f_{6,2,6}=4$$ $$f_{6,2,8}=13$$ $$f_{6,3,5}=3$$ $$f_{6,3,7}=9$$ $$f_{6,3,9}=27$$ $$f_{5,2,5}=3$$ $$f_{5,2,7}=8$$ $$f_{5,2,9}=21$$ $$f_{5,2,11}=55$$ $$f_{6,4,4}=2$$ $$f_{6,4,6}=5$$ $$f_{6,4,8}=14$$ $$f_{5,1,6}=3$$ $$f_{5,1,8}=8$$ $$f_{5,1,10}=21$$ $$f_{5,1,12}=55$$