Giải:
a) Ta có:
\(S=1-3+3^2-3^3+...+3^{98}-3^{99}\)
\(=\left(1-3+3^2-3^3\right)+...+\left(3^{96}-3^{97}+3^{98}-3^{99}\right)\)
\(=1\left(1-3+3^2-3^3\right)+...+3^{96}\left(1-3+3^2-3^3\right)\)
\(=1.\left(-20\right)+3^4.\left(-20\right)+...+3^{96}.\left(-20\right)\)
\(=-20.\left(1+3^4+...+3^{96}\right)\)
\(\Rightarrow S⋮-20\) Hay \(S\in B\left(-20\right)\) (Đpcm)
b) Ta có:
\(S=1-3+3^2-3^3+...+3^{98}-3^{99}\)
\(\Rightarrow3S=3-3^2+3^3-3^4+...+3^{99}-3^{100}\)
\(\Rightarrow3S+S=\left(1-3+3^2-3^3+...+3^{98}-3^{99}\right)+\left(3-3^2+3^3-3^4+...+3^{99}-3^{100}\right)\)
\(\Rightarrow4S=1-3^{100}\)
\(\Rightarrow S=\dfrac{1-3^{100}}{4}\)
Mà \(S\in B\left(-20\right)\Rightarrow S\in Z\)
\(\Leftrightarrow1-3^{100}⋮4\) Hay \(3^{100}-1⋮4\Rightarrow3^{100}\div4\) dư \(1\)
Vậy \(3^{100}\) chia cho \(4\) dư \(1\) (Đpcm)