The "official" formula is 1/2 your age + 7 is the *youngest* you should do.
Seems reasonable, so we need to flip this around...
Thinking back to basic algebra, the answer would be:
(your age - 7) * 2
So if you're 16, it would be 18
If you're 22, it would be 30
If you're 30, it would be 46
If...