The Birthday Problem deals with the probability that, in a set of $k$ randomly-chosen people, at least two will share a birthday. It can be generalized to similar questions of a match with any pair out of $k$ choices with $n$ possibilities for the value-to-be-matched with the function
$$ P_{n}(k) = 1 - \frac{Γ(n + 1)}{Γ(n + 1 - k) × n^k} $$
where $Γ(x + 1)$ is the Gamma function shifted by one unit so it is equal to $x!$ for positive $x$.
In the original shared-birthday context, $n = 365$ (or $365.25$ or $366$, depending on how you deal with leap years), making the function $P_{365}(k) = 1 - \frac{Γ(365 + 1)}{Γ(365 + 1 - k) × 365^k}$. Plugging in values for $k$ lets you find that, for example, you only need a group of 23 randomly-chosen people to have a greater than 50% chance that at least two of them will share a birthday ($P_{365}(23) ≈ 50.73$%, or $P_{366}(23) ≈ 50.63$%).
My question is: is there a closed-form expression for an inverse function $k_{n}(P)$ that gives the number of randomly-chosen people needed for a given probability of a matching pair?
The function $P_{n}(k)$ fails the horizontal line test when looking at its entire domain, but if we restrict our view to the interval $1 < k < n + 1$ it passes. There are other functions that fail the horizontal line test over their full domain but which still have useful inverses, like the trig functions, so I'm hoping something similar can be constructed for this probability function.