Weights in one pan
Every integer can be written as a binary number, that is as a sum a0 + a1.2 + a2.22 + a3.23 + ... where all the coefficients ai are 0 or 1. Hence to weigh all integer weights up to 100 uses weights of 1, 2, 4, 8, 16, 32 and 64 and these weights will balance any integer mass up to 127 units.

To weigh up to 1000 units the additional weights of 256 and 512 are needed and these 9 weights will balance any integer mass up to 1023 units.

With weights 1, 2, 22, ... 2n every integer mass from 1 to 2n+1-1 can be weighed.

Weights in both pans
Every integer can be written as a base 3 number, that is as a sum b0 + b1.3 + b2.32 + b3.33 + ... bn.3n for some n, where all the coefficients bi are 0, 1 or 2.

Suppose you want to weigh an object of mass X units. Then
Y = X + 1 + 3 + 32 + 33 + ... 3n
can be written in base 3 as the sum b0 + b1.3 + b2.32 + b3.33 + ...bn.3n so X can be written as
(b0-1) + (b1-1).3 + (b2-1).32 + (b3-1).33 + ...(bn - 1).3n
where the coefficients (bi - 1) are all -1. 0 or 1. This means that an object of mass X units can be balanced using the weights which have coefficients 1 in this expression in the opposite pan and weights which have coefficients -1 in the same pan as the object and not using the weights that have coefficients 0.