How many times must I flip a coin if I want a 50% chance that I'll flip heads twice in a row? What about 3 times in a rows, 4, etc.? How many times must I flip a coin if I want a 50% chance that I'll flip heads twice in a row? What about 3 times in a rows, 4, etc.?
2 heads in a row should require 4flips to have a 50% chance to get those 2 heads in a row right? This is because with 4 flips you have 16 outcomes and 8 of those outcomes have at least 2 heads in a row.
But what about 3? Etc?
 A: For the case of two consecutive heads, you can express the general term in terms of the $n$th Fibonacci number, by varying slightly the reasoning in this answer (I do this below). The idea is basically considering how you would build a valid sequence of tosses of length $n$ from one of length $n-1$ or length $n-2$ (and that's how Fibonacci pops up).
The probability of at least 2 successive heads after $n$ throws is $$1-\frac{F_{n+2}}{2^n},$$
and indeed, with $n=4$, we have $1-\frac{F_{4+2}}{2^4} = 1 - \frac{8}{16}=\frac12$.
The corresponding sequence is available on OEIS here.
The reasoning for the general case of more than 2 coins generalises similarly. If you want $k$ successive heads, the probability is basically
$$1-\frac{F_{k,\,n+k}}{2^n}$$
where $F_{3,n}$ denotes the $n$th Tribonacci number, $F_{4,n}$ denotes the $n$th Tetranacci number, etc, using the generalised Fibonacci numbers.  See the OEIS sequences for 3 and 4 coins here and here.
Computationally, you can also see that this is not always possible to have probability precisely equal to $\frac12$, e.g., for $k=3$ heads, we have that the probability is $0.46$ when $n=9$, but $0.51$ when $n=10$. Similarly, when $k=4$, we have probability $0.497$ when $n=21$ and probability $0.515$ when $n=22$.

Proof of the formula for the case where $k=2$
Let $F(n)$ denote the number of sequences of the letters in $\{H,T\}$ of length $n$, having no two successive $H$'s. Clearly we have $F(1) = 2$ and $F(2) = 3$.
Now to build a sequence of length $n$ with no successive $H$'s, you can  start from one of length $n-1$ and add a $T$ on the end, or else start from one of length $n-2$ and add an $HT$ to the end. It follows that $$F(n) = F(n-1) + F(n-2),$$
and since $F(1) = 2 = F_3$ and $F(2) = 3 = F_4$, it follows that $F(n) = F_{n+2}$.
Now we are interested in sequences which do contain at least one pair of successive $H$'s, this is simply the remaining ones, i.e., there are $2^n - F_{n+2}$ in number. $\qquad\square$

Generalising the proof for $k\geqslant 3$
The idea is basically induction on $k$. Indeed, we can build a sequence of length $n$ with no successive heads by:

*

*adding a $T$ to one of length $n-1$


*adding an $HT$ to one of length $n-2$


*adding an $HHT$ to one of length $n-3$
$\qquad\vdots$


*adding an $\underbrace{H\cdots H}_{k-1}T$ to one of length $n-k$.
It follows that
$$F(n)=F(n-1) + F(n-2) + \cdots + F(n-k),$$
and by induction, we can establish that $F(n) = F_{k,\,n+k}$ for $1\leqslant n \leqslant k$.
Thus we get that the number of sequences of length $n$ with at least $k$ successive heads somewhere is $2^n - F_{k,\,n+k}$.
