Expected number of coin flips to get two consecutive heads

Let each independent coin flip be heads with probability p, where 0 < p <= 1. Starting with no previous heads, return the expected number of flips until two consecutive heads first appear. The fair-coin theorem is the special case p = 1/2, whose answer is 6.

The two heads must be consecutive, so overlapping trials are dependent. Do not model this as independent attempts with probability p * p and expectation 1 / (p * p).

Examples
Input: 0.01
Output: 10100
Hints

Expected number of coin flips to get two consecutive heads

Let each independent coin flip be heads with probability `p`, where `0 < p <= 1`.