Firstly sorry for the title. I know it's not a good title, but if I knew how to describe this problem in a more elegant way I likely wouldn't have it in the first place.
The problem is the following:
You have a Bernoulli trial with a known p probability of success. You have to figure out the smallest number of trials n such that you have at least a j% chance of obtaining at least k successes (ie; cumulative probability X≥k is greater than j).
j,k, and p are your known variables. You are attempting to find n as the smallest number satisfying the above condition.
Given that the binomial distribution is allergic to closed form solutions I do not expect the problem above to have one, but I'm hopeful I can find a better input estimate for my code, which then uses a stepper function (iterating through higher or lower values of n) to find the true answer. Currently I am using the (very) naive estimate of k/p as a starting value.
Despite lots and lots of googling, I haven't managed to come across this exact question before, mostly stuff relating to the quantile function, which seems to be subtly different.
There does not appear to be a good "closed form" solution (depending on what you mean by "closed form"), and you'll need to do some numeric root-seeking at some level.
But you're right that iteration (stepping up and down) is not a great solution. If the software libraries you're using include a function to calculate the inverse CDF of the negative binomial (i.e. matlab has nbinv, python's scipy library has nbinom.ppf), you're done.
Otherwise, you can use bisection (or any other reasonable root-finding or sorted-searching method) on the CDF (which is fairly easy to evaluate) to find the answer you need.
I think any further details are more a software or programming question.
Do note that there are multiple variations and conventions for the negative binomial distribution. Any given function may be evaluating something different than what you expect.
More details
The negative binomial distribution answers "how many (total $n$/non-counting $k$) samples do I have to get before I hit $r$ (your $k$, unfortunately) samples that count. For your purposes, Wikipedia's second (or third, if you want to swap $p$ and $(1-p)$) "alternative formulation" is appropriate.
The minimum number is the first value on the CDF that is greater than or equal to your $j$%. The CDF is the regularized incomplete beta function $I_p(r, k+1) = I_p(r, n + 1 - r)$ evaluated at each $n \geq r$. This is a polynomial in $p$ for integer $r$ and $n$, but this is little help as you're working with $p$ (and $r$) fixed, and $n$ varying. I'm unaware of any good formula to get from the values of this function to $n$, though as previously noted there are certainly canned routines in some software packages.