Ta có: 21=3 x 7 vì 3 và 7 là 2 số nguyên tố cùng nhau
\(B=2+2^2+2^3+....+2^{30}\)
\(\Rightarrow B=\left(2+2^2\right)+\left(2^3+2^4\right)+....+\left(2^{29}+2^{30}\right)\)
\(\Rightarrow B=2\left(1+2\right)+2^3\left(1+2\right)+....+2^{29}\left(1+2\right)\)
\(\Rightarrow B=2\cdot3+2^3\cdot3+....+2^{29}\cdot3\)
\(\Rightarrow B=3\left(2+2^3+...+2^{29}\right)\)
\(\Rightarrow B⋮3\left(1\right)\)
\(B=2+2^2+2^3+....+2^{30}\)
\(\Rightarrow B=\left(2+2^2+2^3\right)+\left(2^4+2^5+2^6\right)+...+\left(2^{28}+2^{29}+2^{30}\right)\)
\(\Rightarrow B=2\left(1+2+2^2\right)+2^4\left(1+2+2^2\right)+....+2^{28}\left(1+2+2^2\right)\)
\(\Rightarrow B=2\cdot7+2^4\cdot7+...+2^{28}\cdot7\)
\(\Rightarrow B=7\left(2+2^4+....+2^{28}\right)\)
\(\Rightarrow B⋮7\left(2\right)\)
(1) (2) => B chia hết cho 21 (đpcm)