Ta có:
\(\left(1+1\right)^{40}=C_{40}^0+C_{40}^1+...+C_{40}^{39}+C_{40}^{40}\)
\(\left(1-1\right)^{40}=C_{40}^0-C_{40}^1+...-C_{40}^{39}+C_{40}^{40}\)
Trừ vế cho vế:
\(2^{40}=2\left(C_{40}^1+C_{40}^3+...+C_{40}^{39}\right)\)
\(\Rightarrow S=2^{39}\)