Show that every positive integer is an alternating sum of
strictly increasing powers of 2.
For example, 5=2^0 -2^2 +2^3 and 8=-2^3 +2^4 are alternating sums of strictly increasing powers of 2 (8=2^3 is ok too).
10=-2^1 -2^2 +2^4 is a strictly increasing sum but not alternating.
4=2^1 -2^1 +2^2 is alternating but not strictly increasing.
(author: prof Dan Shapiro of Ohio State University)
Certainly every positive integer can be written as the sum of (positive) strictly decreasing powers of 2 -- that's just its binary representation (I know the problem asks for increasing, but any strictly decreasing alternating representation can be reversed for a strictly increasing one--I'll do that last). so a number N = 2^a+2^b+2^c... and so on, where a> b > c...
Now write every 2^i as (2^i+1 -2^i) (which it is; 2^i+1 = 2*2^i and 2*2^i - 2^i = 2^i). Then N = (2^a+1 - 2^a) + (2^b+1 - 2^b) + (2^c+1 - 2^c) + ... This is clearly alternating, but it's not quite a solution--it may be that a=b+1 (or that any two consecutive exponents differ by one.) In that case, the -2^a and the +2^b+1 cancel each other out and disappear from the representation, and since we've removed one consecutive -/+ pair from an alternating sequence, the resulting sequence is still alternating.
Eliminate all such matching terms, and then re-order the terms in reverse order. You now possess a representation of your number N which is an alternating sum of strictly increasing powers of two.
|
Posted by Paul
on 2005-06-18 01:46:25 |