When is $\frac{An+B}{Cn+D}$ irreducible for all $n\in\mathbb{N}$? Consider fractions of the form $\frac{An+B}{Cn+D}$.
$A, B, C, D$ are positive integers.
Under what conditions will these produce an irreducible fraction (no common integer factor in numerator and denominator), for all positive integers $n$?
 A: Proposition: $\frac{An+B}{Cn+D}$ is irreducible for all $n\in\mathbb{N}$ if and only if $gcd(A,B,C,D)=1$ and all the prime factors of $AD-BC$ divide $(A,C)$.
Proof:
Suppose that $gcd(A,B,C,D)=1$ and all the prime factors of $AD-BC$ divide $(A,C)$. We will prove that $\frac{An+B}{Cn+D}$ is irreducible.
Suppose not. Then, there exists prime $p$ such that $An+B\equiv Cn+D\equiv 0 \pmod{p}$.
Therefore, $A(Cn+D)-C(An+B)\equiv AD-BC \equiv 0 \pmod{p}$.
By our hypothesis, $p|(A,C)\implies A\equiv C\equiv 0 \pmod{p}\implies B\equiv D\equiv 0 \pmod{p}$, a contradiction to $gcd(A,B,C,D)=1$.
Now, suppose that there is a prime $p$ dividing $AD-BC$ which does not divide $(A,C)$. We will prove that there exists $n\in\mathbb{N}$ such that $\frac{An+B}{Cn+D}$ is reducible.
If $p$ does not divide $A$ or $C$, $n\equiv\frac{-B}{A}\equiv\frac{-D}{C}\pmod{p}$ works.
When $p$ divides $A$, $p$ does not divide $C$. Therefore, $p$ divides $B$ and $p$ always divides the numerator. Choosing $n\equiv\frac{-D}{C}\pmod{p}$ ensures $p$ divides the denominator too. A similar choice works when $p$ divides $C$ but not $A$.
$\blacksquare$
