user
Two integers 

N
{\displaystyle {\displaystyle N}}
 and 

M
{\displaystyle {\displaystyle M}}
 are said to be amicable pairs if 

N
≠
M
{\displaystyle {\displaystyle N\neq M}}
 and the sum of the proper divisors of 

N
{\displaystyle {\displaystyle N}}
 (

s
u
m
(

p
r
o
p
D
i
v
s
(
N
)
)
{\displaystyle {\displaystyle \mathrm {sum} (\mathrm {propDivs} (N))}}
) 

=
M
{\displaystyle {\displaystyle =M}}
 as well as 

s
u
m
(

p
r
o
p
D
i
v
s
(
M
)
)
=
N
{\displaystyle {\displaystyle \mathrm {sum} (\mathrm {propDivs} (M))=N}}
.

Example

**1184** and **1210** are an amicable pair, with proper divisors:

* 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592   and
* 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605   respectively.

Task

Calculate and show here the Amicable pairs below 20,000; (there are eight).

Related tasks

* Proper divisors
* Abundant, deficient and perfect number classifications
* Aliquot sequence classifications and its amicable *classification*.
assistant
(formerly Perl 6)

**Works with**: Rakudo version 2019.03.1

```
sub propdivsum (\x) {
    my @l = 1 if x > 1;
    (2 .. x.sqrt.floor).map: -> \d {
        unless x % d { @l.push: d; my \y = x div d; @l.push: y if y != d }
    }
    sum @l
}

(1..20000).race.map: -> $i {
    my $j = propdivsum($i);
    say "$i $j" if $j > $i and $i == propdivsum($j);
}

```

Output:

```
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
```