If $a=qbc+rb+s$ with $0\le s\le b-1$ and $0\le r\le c-1$, you want to find $r$. Namely, $qc+r=\lfloor \frac ab\rfloor$ and $r=(qc+r)\bmod c$.
To do so, note that $0\le rb+s\le bc-1$ so that $rb+s=a\bmod{bc}$, from which we find $r=\lfloor \frac{a\bmod{bc}}b\rfloor$.
The computattion $a\equiv \frac{x^n-1}{x-1}\pmod {bc}$ is easy if $\gcd(x-1,bc)=1$, but that need not be the case. We can use a recursion on $a_n:=1+x+\cdots +x^n$ directly, noting that
$$a_{2k}=(x^k+1)\cdot a_k\qquad \text{and}\qquad a_{k+1}= x\cdot a_k. $$
Using this, you find $a\bmod{bc}$ in $O(\log n)$ multiplications modulo $bc$. For these modular multiplications, you may want to be able to handle $80$ bit unsigned integer multiplications (because $bc$ can be almost $2^{40}$, but not more) for intermediate results. Or work in a mixed base representation and define addition and multiplication $\bmod {bc}$ for ordered pairs $\langle u,v\rangle$ with $0\le u<c$, $0\le v<b$, representing the number $ub+v\bmod{bc}$.