asked 8.7k views
1 vote
Of the positive integers less than 2021, how many can be written

as a difference of two powers of 2?

asked
User Movac
by
8.6k points

1 Answer

4 votes

Answer:

61

Explanation:

You want the number of positive integers less than 2021 that can be written as the difference of two powers of 2.

Powers of 2

2^12 = 4096 and higher powers cannot produce integers less than 2021 when other powers of 2 are subtracted. Hence we're looking for pairs of powers that are 2^11 and smaller.

2^11 = 2048, which is 27 more than 2021. This means a number in range can be generated only by subtracting a power of 2 from 2^11 that is 2^5 = 32 or greater.

Combinations

There are 66 pairs (combinations) of numbers in the range 0 to 11. Except for the 5 pairs (11, 0), (11, 1), (11, 2), (11, 3), (11, 4), they all represent pairs of powers of 2 that will have a unique difference less than 2021.

There are 61 positive integers less than 2021 that can be written as the difference of powers of 2.

answered
User Nhor
by
7.9k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.