a) Vì \(n+1⋮n+4\)
\(\Rightarrow\left(n+4\right)-3⋮n+4\)
mà \(n+4⋮n+4\Rightarrow3⋮n+4\)
\(\Rightarrow n+4\inƯ\left(3\right)\)
\(\Rightarrow n+4\in\left\{\pm1;\pm3\right\}\)
...
b) Do \(2n-5⋮n+1\)
\(\Rightarrow2\left(n+1\right)-7⋮n+1\)
mà \(2\left(n+1\right)⋮n+1\Rightarrow7⋮n+1\)
\(\Rightarrow n+1\inƯ\left(7\right)\)
\(\Rightarrow n+ 1\in\left\{\pm1;\pm7\right\}\)
....
Vậy \(n\in\left\{...\right\}\)