Find Pythagorean Triple with Perimeter == 24
There is no need for Lists a,b, and c, only one of them is needed.

So the flatmap could just use a three times: 

a.flatMap(x =&gt; 
  a.flatMap(y =&gt; 
    a.flatMap(z =&gt; sumsEqualsTo24(x, y, z))))


For comprehensions can use extractors as you would in pattern matching or declaring a val.
You may find this more readable:

  ...
  c &lt;- List.range(1, 11) 
  (x,y,z) &lt;- sumsEqualsTo24(a,b,c)
  _ &lt;- pythagTriplebar(x,y,z)
} yield (a,b,c)


Likewise you can have

val ys = xs.flatMap{case (x,y,z) =&gt; pythagTriple(x,y,z)}