```python
def amicable_numbers_sum(limit):
    """
    Calculates the sum of all amicable numbers from 1 to a specified limit.

    Amicable numbers are two different numbers so related that the sum of the
    proper divisors of each is equal to the other number.
    """
    if limit < 284:
        return 0

    div_sums = [0] * (limit + 1)
    for i in range(1, limit // 2 + 1):
        for j in range(i * 2, limit + 1, i):
            div_sums[j] += i

    total_sum = 0
    for a in range(1, limit + 1):
        b = div_sums[a]
        if a < b and b <= limit and div_sums[b] == a:
            total_sum += a + b
            
    return total_sum
```