\(B=5+5^2+5^3+5^4+5^5+...+5^{11}+5^{12}\)
\(B=\left(5+5^2+5^3\right)+\left(5^4+5^5+5^6\right)+...+\left(5^{10}+5^{11}+5^{12}\right)\)
\(B=5\left(1+5+5^2\right)+5^4\left(1+5+5^2\right)+...+5^{10}\left(1+5+5^2\right)\)
\(B=5.31+5^4.31+...+5^{10}.31\)
\(B=31\left(5+5^4+...+5^{10}\right)⋮31\)