How do we find solutions $(u,v)$ to the congruence
$$(v-u)(v+u-1) \equiv 0 ~ (\text{mod }2(v-1))$$?
Specifically, we would like to find all solutions with $v$ and $u$ positive integers and $v \geq u$.
How do we find solutions $(u,v)$ to the congruence
$$(v-u)(v+u-1) \equiv 0 ~ (\text{mod }2(v-1))$$?
Specifically, we would like to find all solutions with $v$ and $u$ positive integers and $v \geq u$.
One of $v-u$, $v+u-1$ is even. Therefore, if $v=2h$ is even the $\pmod 2$ part is trivial and we are left with $(v-u)(v+u-1)\equiv 0\pmod{v-1}$, i.e. $$u^2-u\equiv 0\pmod{v-1}$$ This gives us immediately the solutions $u=1$, $u=v-1$ and $u=v$ (which work also if $v$ is odd). In fact, for any prime power $p^k|v-1$ we have only the solutions $u\equiv 0,1\pmod{p^k}$ and combine these to more solutions (doubling the count of sulutions with $u<v$ for each additional prime divisor of $v-1$) using the Chinese remainder theorem. For example, if $v=106=3\cdot5\cdot 7+1$, we get $u\in\{1,15,21,36,70,85,91,105,106\}$ from $u\equiv 0,1\pmod 3$, $u\equiv 0,1\pmod 5$, $u\equiv 0,1\pmod 7$ .
If $v$ is odd, essentially the same applies, but the prime $p=2$ may spoil a lot. For example, if $v=2^k+1$, then the only solutions with $1\le u\le v$ are $u=v-1$ and $u=v$. More generally, if $w$ is odd, then the number of solutions with $v=2^kw+1$ is the same as with $v=w+1$.