ta có: \(n^2+5=n^2-n+n-1+6=n\left(n-1\right)+\left(n-1\right)+6=\left(n-1\right)\left(n+1\right)+6\)
\(\left(n^2+5\right)\) chia hết cho (n+1)\(\Rightarrow\left(n-1\right)\left(n+1\right)+6⋮\left(n+1\right)\)
\(\Rightarrow6⋮\left(n+1\right)\Rightarrow\left(n+1\right)\inƯ\left(6\right)=\left\{1,2,3,6\right\}\Rightarrow n\in\left\{0,1,2,5\right\}\)
ta có: 13n = 13n -13+13= 13(n-1) +13
\(13n⋮\left(n-1\right)\Rightarrow\left(13\left(n-1\right)+13\right)⋮\left(n-1\right)\Rightarrow\left(n-1\right)\inƯ\left(13\right)=\left\{1,13\right\}\)
\(\Rightarrow n\in\left\{2,14\right\}\)