\(x\left(x^2+1\right)\left(x^2+4\right)\\ =x\left(x^2-4+5\right)\left(x^2+4\right)\\ =x\left(x^2-4\right)\left(x^2+4\right)+5x\left(x^2+4\right)\\ =x\left(x-2\right)\left(x+2\right)\left(x^2-1+5\right)+5x\left(x^2+4\right)\\ =x\left(x-2\right)\left(x+2\right)\left(x-1\right)\left(x+1\right)+5x\left(x^2+4\right)+5x\left(x-2\right)\left(x+2\right)\)
Vì \(x-2,x-1,x,x+1,x+2\) là 5 số nguyên nên có ít nhất 1 số chia hết cho 5 \(\Rightarrow x\left(x-2\right)\left(x+2\right)\left(x-1\right)\left(x+1\right)⋮5⋮5\forall x\in Z\)
\(5x\left(x^2+4\right)⋮5⋮5\forall x\in Z\)
\(5x\left(x-2\right)\left(x+2\right)⋮5⋮5\forall x\in Z\)
\(\Rightarrow x\left(x-2\right)\left(x+2\right)\left(x-1\right)\left(x+1\right)+5x\left(x^2+4\right)+5x\left(x-2\right)\left(x+2\right)⋮5⋮5\forall x\in Z\)
\(\Rightarrow n\left(n^2+1\right)\left(n^2+4\right)⋮5\forall x\in Z\)
Lời giải:
Nếu $n\vdots 5$ thì $B\vdots 5$
Nếu $n$ chia $5$ dư $1$ thì đặt $n=5k+1$.
$n^2+4=(5k+1)^2+4=5(5k^2+2k+1)\vdots 5\Rightarrow B\vdots 5$
Nếu $n$ chia $5$ dư $2$ thì đặt $n=5k+2$
$n^2+1=(5k+2)^2+1=5(5k^2+4k+1)\vdots 5\Rightarrow B\vdots 5$
Nếu $n$ chia $5$ dư $3$ thì đặt $n=5k+3$
$n^2+1=(5k+3)^2+1=5(5k^2+6k+2)\vdots 5\Rightarrow B\vdots 5$
Nếu $n$ chia $5$ dư $4$ thì đặt $n=5k+4$
$n^2+4=(5k+4)^2+4=5(5k^2+8k+4)\vdots 5\Rightarrow B\vdots 5$
Vậy $B\vdots 5$