def amicable_numbers_sum(limit):
    def sum_divisors(n):
        if n < 2:
            return 0
        total = 1
        i = 2
        while i * i <= n:
            if n % i == 0:
                total += i
                if i != n // i:
                    total += n // i
            i += 1
        return total
    
    result = 0
    for n in range(2, limit + 1):
        s = sum_divisors(n)
        if s != n and sum_divisors(s) == n:
            result += n
    return result