- $m\equiv 0 (\text{mod} 3)$: This one is trickier. $m+1,4m+1$ are congruent to 1 modulo 3, hence the fraction (ignoring the factor of 4) is congruent to 1 mod3, and we need $y$ congruent to 2, so we have to get from the numerator a proper factor congruent to 2 (and then eliminate the rest using the denominator). WeIf $m$ is odd, then we can factor out a 2 from the hanging 4 to get the desired congruence, but then we are not sure anymore that via $y$ is indeed a multiple of 4. To be so$2(m+1)$ in the numerator, eithersince then $m+1$ or $4m+1$ must beis even, and hence it$y$ is necessary and sufficient thatmultiple of $m$ be odd$4$. Thus:
If $m$ is even, i (i.e., if $n=24t+1$multiple of 6), then there is noa solution if and only if we can find a proper factor $F\equiv 2(\text{mod}3)$ inside $(m+1)^2(4m+1)^2$, iff $m+1$ or $4m+1$ contains such an $F$, in which case it contains another factor $G\equiv 2(\text{mod}3)$ (i.e., those factors come in pairs since $m+1,4m+1\equiv 1(\text{mod}3)$). Then $3k=(m+1)^2(4m+1)^2/F+(m+1)(4m+1)$ is valid and $y=4F$ is a solution (from this we infer that the possible solutions are of the form $y=12s+8$, $m+1$ or $4m+1$ multiple of $3s+2$).
For example, if:
- $m=6$ then $m+1=7$, $4m+1=25=5\cdot5$, $F=5$ does the job with $y=20$.
- $m=12$ then $m+1=13$, $4m+1=49=7\cdot7$ and there is no solution.
- $m=18$ then $m+1=19$, $4m+1=73$ and there is no solution.
- $m=24$ then $m+1=25=5\cdot 5$, $F=5$, $y=20$.