R, 62 bytes
function(a,b)sum(which(!a%%1:a))-a==b|sum(which(!b%%1:b))-b==a
returns TRUE for amicable, FALSE for not.
Giuseppe
- 29.4k
- 3
- 33
- 106
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange