Ta có:
\(A=\left(2n+1\right)\left(n^2-3n-1\right)-2n^3+1\)
\(A=2n\left(n^2-3n-1\right)+\left(n^2-3n-1\right)-2n^3+1\)
\(A=2n^3-6n^2-2n+n^2-3n-1-2n^3+1\)
\(A=-5n^2-5n\)
\(A=5\left(-1n^2-n\right)\)\(⋮5\)
\(\Rightarrow A⋮5\)
Vậy với \(n\in Z\) thì \(A=\left(2n+1\right)\left(n^2-3n-1\right)-2n^3+1⋮5\) (ĐPCM)