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

4 of 6
added 2 characters in body
user avatar
user avatar

#APL NARS, bytes 46, 22 chars

{∧/(t=-⍵-11π⍵),⍵≠t←⌽⍵}

11π⍵ find the sum of divisors of ⍵ in 1..⍵; Note the question want (11π⍵)-⍵

(11π⍵)-⍵=-(⍵-11π⍵)=-⍵-11π⍵ follow APLsm precedence

The test:

 z←{∧/(t=-⍵-11π⍵),⍵≠t←⌽⍵}
 z 284 220⋄z 52 100⋄z 10744 10856 ⋄z 174292 2345
1
0
1
0
 z 100 117⋄z 6 11⋄z 495 495⋄z 6 6 
0
0
0
0
user58988

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