Ta có \(B=\left(1+5+5^2\right)+\left(5^3+5^4+5^5\right)+...+\left(5^{96}+5^{97}+5^{98}\right)\)
\(B=\left(1+5+5^2\right)+5^3.\left(1+5+5^2\right)+...+5^{96}.\left(1+5+5^2\right)\)
\(B=31+5^3.31+...+5^{96}.31\)
\(B=31.\left(1+5^3+5^6+...+5^{96}\right)\) chia hết cho 31.