Setting $a=a_1+ca_2$, $d=d_1+cd_2$ we'll get $$S(m,n,c,q)=\sum_{a_1d_1\equiv 1\pmod c}e\left(\frac{a_1m+d_1n}{cq}\right)\sum_{a_2,d_2=1}^qe\left(\frac{a_2m+d_2n}{q}\right).$$ The inner (linear) sums can be calculated explicitely $$S(m,n,c,q)=q^2\delta_q(m)\delta_q(n)\sum_{a_1d_1\equiv 1\pmod c}e\left(\frac{a_1m/q+d_1n/q}{cq}\right)=q^2\delta_q(m)\delta_q(n)S(m/q,n/q,c),$$ where $S(m,n,c)$ is a usual Kloosterman sum.
Alexey Ustinov
- 12.3k
- 7
- 87
- 119