B = 2^20 - ( 2^19 + 2^18 + 2^17 + ... + 2^1 + 2^0)
Đặt A = 2^19 + 2^18 + 2^17 + ... + 2^1 + 2^0
A = 2^0 + 2^1 + ... + 2^17 + 2^18 + 2^19
2A = 2^1 + 2^2 + ... + 2^18 + 2^19 + 2^20
2A - A = (2^1 + 2^2 + ... + 2^18 + 2^19 + 2^20) - (2^0 + 2^1 + ... + 2^17 + 2^18 + 2^19)
A = 2^20 - 2^0
A = 2^20 - 1
B = 2^20 - (2^20 - 1)
B = 2^20 - 2^20 + 1
B = 1
Đặt A=2^19+2^18+2^17+...+2^1+2^0
2A=2^20+2^19+2^18+...+2^2+2^1
2A-A=2^20-2^0
A=2^20-1
=>B=2^20-A
=2^20-2^20-1
=1
Đơn giản như đang giỡn fải ko? k nha!
B = 2^20 - ( 2^19 + 2^18 + 2^17 + ... + 2^1 + 2^0)
Đặt A = 2^19 + 2^18 + 2^17 + ... + 2^1 + 2^0
A = 2^0 + 2^1 + ... + 2^17 + 2^18 + 2^19
2A = 2^1 + 2^2 + ... + 2^18 + 2^19 + 2^20
2A - A = (2^1 + 2^2 + ... + 2^18 + 2^19 + 2^20) - (2^0 + 2^1 + ... + 2^17 + 2^18 + 2^19)
A = 2^20 - 2^0
A = 2^20 - 1
B = 2^20 - (2^20 - 1)
B = 2^20 - 2^20 + 1
B = 1