For the equation \begin{equation} a = \frac{n(4m-1)}{4b} \end{equation} where $n,m,a$ and $b$ are positive integers and $1\leq a,b\leq n$, how many valid, unique solutions $(a,m)$ exist for fixed $n$ and $b$? I am also interested in a weaker form of the question: what is the maximum number of solutions possible for any given $n$?
I understand that $n$ has to be divisible by 4, but I am unsure about the division by $b$ since it could be any integer from $1$ to $n$ and $m$ is a "free" parameter that does not have any constraints (besides being integer). Unfortunately, my handle on number theory is rather weak so I also don't know how to convert this information into finding the number of solutions.
Since $n$ is a multiple of $4$, we might as well let $n=4q$ and we are looking at $ab=q(4m-1)$.
Temporarily let us not worry about the condition $a\le n=4q$. Then $m$ gives a solution precisely if $b$ divides $q(4m-1)$. Let $\gcd(b,q)=d$ and let $b=db'$, $q=dq'$. So we want $b'$ to divide $q'(4m-1)$, and therefore we want $b'$ to divide $4m-1$.
If $b'$ is even, there is no solution. So let $b'$ be odd. Then, without considering the condition $a\le n$, we have infinitely many solutions.
Now the condition $a\le n$ can be dealt with easily. If there is a solution, then $m$ gives a solution if and only if $4nb\ge n(4m-1)$, that is, if $4m-1\le 4b$. There are $b$ possibilities.