Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

3 of 4
deleted 177 characters in body
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 62 bytes

function(a,b)sum(which(!a%%1:a))-a==b|sum(which(!b%%1:b))-b==a

Try it online!

returns TRUE for amicable, FALSE for not.

Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

AltStyle によって変換されたページ (->オリジナル) /