One of the reasons this is a difficult number to calculate is that there are a significant number of cases where, in a finite number of flips, the desired triplet doesn't occur at all.
Consider the OP with 17 coin flips. If you're looking for TTT, any combination of 17 flips where the coin lands heads-up at least 15 times will eliminate the possibility of TTT occurring. There are also numerous other cases where TTT doesn't occur in 17 flips (for example, TTHTTHTTHTTHTTHTT).
I haven't carried it out all the way to figure out in how many of the 17-flip cases TTT doesn't occur (or any of the other 7 triplets, for that matter), but what do we say about how many coin flips are required for that triplet to occur in those cases? It's definitely greater than 17, but how much greater? It's relatively easy to go through and figure out how many times TTT first occurs after 3, 4, 5, ..., 17 flips, and then multiply the number of flips by the relative probability of each case and sum to get the overall average number of flips required, assuming the triplet occurs at all. But I still don't know what to do with the cases where TTT doesn't occur at all.
One thought would be to allow the number of flips (n) to increase until n approaches infinity, but then I think you get into a situation where for an infinitesimally small probability of occurrence (p = 0.000000....), the triplet occurs after infinite flips, and zero times infinity is undefined.
Another thought, and better I think, would be to try to figure it out this way: