**Background**: Data about herpesvirus microRNA motifs on human circular RNAs suggested the following statistical question. Consider independent random counts, not necessarily identically distributed. Conditioned on the sum, decide whether one of the counts is unusually large. Exact computation of the p-value leads to a specific algorithmic problem. Given *n* elements *g*0,*g*1,...*g*n-1 in a set with the closure and associative properties and a commutative product without inverses, compute the jackknife (leave-one-out) products gbar;=*g*0,*g*1,...*g**j-1 **g* j+1...

*g*

(0≤

*n-1**j<n*).

**Results**: This article gives a linear-time Jackknife Product algorithm. Its upward phase constructs a standard segment tree for computing segment products like g[i,j)=*g**i**g**i+1**...g* j-1; its novel downward phase mirrors the upward phase while exploiting the symmetry of and its complement gbar;

. The algorithm requires storage for elements of and only about products. In contrast, the standard segment tree algorithms require about

*j**n*products for construction and log

2

*n*products for calculating each gbar;

, i.e., about products

*j**n*log

*n*in total; and a naïve quadratic algorithm using

*n*-2 element-by-element products to compute each gbar;

*j**requires*

*n*(

*n*-2) products.

**Conclusions**: In the herpesvirus application, the Jackknife Product algorithm required 15 minutes; standard segment tree algorithms would have taken an estimated 3 hours; and the quadratic algorithm, an estimated 1 month. The Jackknife Product algorithm has many possible uses in bioinformatics and statistics.