Counting integers related to Bézout's identity I am reading a proof on a double sums and I don't understand. Here is the context:
Let $p,q$ two fixed integers and $k\in[1,\lfloor\frac{N}{p}\rfloor-1],l\in[1,\lfloor\frac{N}{q}\rfloor-1].$
Now he said that there is for all $n\in[-\lfloor\frac{N}{pq}\rfloor,\lfloor\frac{N}{pq}\rfloor]$ (interval of integers) $$\gcd(p,q)\times \lfloor\frac{N}{pq}\rfloor$$ couples $(k,l)$ such that $$n\gcd(p,q)=pk-ql$$
It's seems related to Bezout's identity but I don't see how to prove this.
 A: I started trying to prove this when I realized it's not always true as currently stated. For a fairly simple example, let $p = q = 2$ and $N = 4$. Then $\gcd(p,q) = 2$, $\left\lfloor\frac{N}{p}\right\rfloor = 2$, $\left\lfloor\frac{N}{q}\right\rfloor = 2$ and $\left\lfloor\frac{N}{pq}\right\rfloor = 1$. Also,
$$k\in \left[1,\left\lfloor\frac{N}{p}\right\rfloor-1\right] = [1,2-1] = [1,1] \tag{1}\label{eq1}$$
$$l\in \left[1,\left\lfloor\frac{N}{q}\right\rfloor-1\right] = [1,2-1] = [1,1] \tag{2}\label{eq2}$$
Next, note that
$$n\gcd(p,q)=pk-ql \; \Rightarrow \; 2n = 2k - 2l \tag{3}\label{eq3}$$
The range for $n$ becomes
$$n\in\left[-\left\lfloor \frac{N}{pq} \right\rfloor,\left\lfloor \frac{N}{pq} \right\rfloor\right] = [-1,1] \tag{4}\label{eq4}$$
The stated total # of solutions becomes
$$\gcd(p,q) \times \left\lfloor \frac{N}{pq} \right\rfloor = 2 \times 1 = 2 \tag{5}\label{eq5}$$
However, as $k = l = 1$ are the only allowed values to choose from, the RHS of \eqref{eq3} has a sole value of $0$, giving just $n = 0$ as the only value allowed in the range given in \eqref{eq4}. However, this means there is just $1$ couple of $(k,l)$, which doesn't match the value of $2$ given in \eqref{eq5} as the expected number of solutions.
It seems either something is incorrect in the provided details or additional conditions are required for what you're trying to prove to always be true. As you only say that $p$ and $q$ are fixed, perhaps you're meant to show some $N$ exists which satisfies all of the conditions? I believe this may be the case, but I won't try to prove it unless you confirm this is actually what is required.
