# How do I solve this question regarding algebra? [duplicate]

There is a $$1 \mathrm{gm}$$ weight on each side of a balance. If Harry Potter casts a spell with his magic wand on any of the weights, then the mass of that particular weight doubles, but the other weight remains unchanged. How many masses between 1 and 1000 gm inclusive can be measured using this balance?

Attempt by Suzu Hirose

The maximum number from 1,000 to, say, 10, or even 5, and then enumerate the possible cases. Double one side and you can weigh 2-1=1g, then double twice and you can weigh 4-1=3g, then double the other side and you can weigh 4-2=2g, double the other side again and you can weigh 8-2=6g, and so on. If you just enumerate all the possibilities for a lower number, the way to solve the problem for the general case should become fairly obvious.

• Rather than reposting the same question you should edit the original one with what you added here.
– dxiv
Jun 26 at 6:33
• Just realized that the attempt here is identical to Suzu Hirose's answer to the other question. Jun 26 at 6:48

In your last post you asked for a hint, so here it is. A weight can be measured exactly when it is the difference between two powers of two. Therefore in each interval $$[2^k,2^{k+1})$$ there will be exactly $$k+1$$ measurable weights, for $$2^{k+1}-1,2^{k+1}-2,...,2^{k+1}-2^k$$.