Problem. Which set of weights lets a balance measure every integer weight with as few weights as possible?

Weights may go onOptimal setCovers
one pan only (binary)
both pans (balanced ternary): 4 weights cover
vector<int> balancedTernary(long long w) {        // w = sum d_i 3^i, d_i in {-1, 0, 1}: +1 = weight on the other pan, -1 = with the object
    vector<int> d;
    while (w) { int r = w % 3; if (r == 2) r = -1; d.push_back(r); w = (w - r) / 3; }
    return d;
}