A coin having probability $p$ of coming up heads is successively flipped until the $r^{th}$ head appears. Let $X$ be the number of flips required. Find the probability $P(X=n)$. 

So this means I need to find the probability that $n$ flips are needed to get the $r^{th}$ head. I am not sure how to proceed. Any help/clarification please?

Thank you. 


Question: Inverse fourier transform of exponentially decaying function in the frequency domain
Answer: This would amount to compute the Fourier transform of a streched exponential, which has no simple-closed form formula, it's known as the Kohlrausch–Williams–Watts function. See also here.