------
## 最终结论
```python
def sum_of_widths(A):
    MOD = 10**9 + 7
    n = len(A)
    A.sort()
    
    total_width_sum = 0
    for i in range(n):
        max_contrib = A[i] * (1 << i) % MOD  # 2^i
        min_contrib = A[i] * (1 << (n - 1 - i)) % MOD  # 2^(n-1-i)
        total_width_sum = (total_width_sum + max_contrib - min_contrib) % MOD
    
    return total_width_sum

# Example usage:
print(sum_of_widths([2, 1, 3]))  # Output: 6
```