Source of below formula’s can be found here: Compact RSA inclusion/exclusion proofs
We have to show that:
A_{t+1} \equiv A_{t}^x \mod N
where x is the product of the primes the operator wants to add.
We substitute for x:
x = B\lfloor \frac x B \rfloor + x \mod B
We use the following witnesses:
b=A_{t}^{\lfloor \frac x B \rfloor} \mod N
r=x \mod B
Now the verifier has to check:
b^B.A_{t}^r \equiv A_{t}^x \equiv A_{t+1} \mod N
If this verification is done on chain, all clients can be sure no prime has ever been removed.