On Sun, Sep 4, 2011 at 12:23 PM, Kane Williams <theburrick / hotmail.com> wrote:
> ghci> let rightTriangles' = [ (a,b,c) | c <- [1..10], b <- [1..c], a <-
> [1..b], a^2 + b^2 == c^2, a+b+c == 24]
> ghci> rightTriangles'
> [(6,8,10)]

try,

(1..10).to_a.permutation(3).select{|a,b,c| a+b+c==24 && a**2+b**2==c**2}
#=> [[6, 8, 10], [8, 6, 10]]

kind regards -botp