Let $\alpha\ge 1$ be an even integer, and $k$ an intger s.t, $1\le k\le \alpha$. Set $\alpha'=\alpha/2$, $$ A=\mathrm{Card}(\{n : 0\le n\le k-1, k\mid\alpha'(4n+1)\}),\quad B=\mathrm{Card}(\{n : 0\le n\le k-1, k\mid\alpha'(4n+3)\}) $$ So my question is: Can we find $A$ and $B$ explicitly in terms of $\alpha'$ and $k$? I tried with some examples and I suspect that, if $2^g\mid\mid \alpha$ (i.e., $\alpha=2^g\beta$ with $\gcd(\beta,2)=1$) then
$$ A=B=\left\{ \begin{array}{cc} 0 & \mbox{if} \;k\; \mbox{multiple of} \;2^g\\ \gcd(\alpha',k) & \mbox{otherwise.} \\ \end{array} \right. $$ I am pretty sure that this is true,but I don't know how to prove it formally.