code: private static long specialNPrimeB(final long numSamplesI, final double p, final double delta) {
      final double q, numSamplesF, oneMinusDelta;
      double tot, curTerm;
      long m;
      assertTrue(numSamplesI >= 1);
      assertTrue((0.0 < p) && (p < 1.0));
      assertTrue((0.0 < delta) && (delta < 1.0));
      q = 1.0 - p;
      oneMinusDelta = 1.0 - delta;
      numSamplesF = numSamplesI;
      curTerm = Math.pow(p, numSamplesF);  // curTerm = posteriorProbability (k, k, p)
      assertTrue(curTerm > 1e-100); // sanity check for non-use of logarithms
      tot = curTerm;
      m = numSamplesI;
      while (tot < oneMinusDelta) {
        curTerm = (curTerm * q * (m)) / ((m + 1) - numSamplesI);
        tot += curTerm;
        m += 1;
      }
      return (m); // don't need to back up
    }
docs: The above remarks about specialNStar() also apply here.