~pmikkelsen/euler-apl

b8dbada09db935e503e3b3de34e2df485beec0dc — Peter Mikkelsen 6 months ago 4aa2f57
Solve euler 39
1 files changed, 5 insertions(+), 0 deletions(-)

A Euler39.aplf
A Euler39.aplf => Euler39.aplf +5 -0
@@ 0,0 1,5 @@
 r←Euler39;c;p;pairs;perims
 pairs←∪{⍵[⍋⍵]}¨⍸∘.{c←(+⌿⍺ ⍵*2)*0.5 ⋄ c=⌈c}⍨⍳500
 perims←{+⌿⍺ ⍵,0.5*⍨+⌿⍺ ⍵*2}⌿¨pairs
 (p c)←↓⍉{⍺,≢⍵}⌸perims
 r←p[⊃⍒c]