Answer
$n=\frac{l-a+d}{d}$
Work Step by Step
To solve the given equation for $n$, we do the following steps
$$
l = a + (n - 1)d\Longrightarrow l=a+nd-d\\
\Longrightarrow nd=l-a+d\\
\Longrightarrow \frac{nd}{d}=\frac{l-a+d}{d}\\
\Longrightarrow n=\frac{l-a+d}{d}
.$$