Write a Python function `sum_amicable_numbers(limit)` that calculates the sum of all amicable numbers from 1 to a given limit (inclusive). Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number.
#### Example Usage
```python [main.nopy]
print(sum_amicable_numbers(300)) # Output: 504
print(sum_amicable_numbers(10000)) # Output: 31626
```
#### Constraints
- The input `limit` will be a positive integer.
- Proper divisors of a number are all divisors excluding the number itself.