Digit-Coefficient Tester

Tests whether dk(n) = ak when n ≥ m² + k + ak+1.

We use P(x) ∈ Z[x] (monic) and assume ak ≥ 0 for all k, where ak is the coefficient of xk in 1 / P((1-mx)/x). The scan runs over m = mmin..mmax. The digit dk(n) is the k-th digit after the decimal point of 1 / P(n) in base (n + m), using 1-based indexing (k = 1 is the first digit). The scan skips cases where ak or ak+1 is negative or non-integer. In random mode we require ak ≥ 0 and integer for k ≤ kmax + 1 and all m in the scan. The test condition is n ≥ m² + k + ak+1. In xj mode we test: if k ≥ m(j−1)+j−2 and Ck < n, then dk(n)=Ck+1.