Stream<int[]> stream= IntStream.rangeClosed(1,100).boxed().
flatMap(
a->
IntStream.rangeClosed(a,100).
filter(b->
Math.sqrt(a*a+b*b)%1==0).
mapToObj(b->
new int[]{a, b, (int) Math.sqrt(a * a + b * b)}
)
);
stream.forEach(a->
System.out.println(a[0]+","+a[1]+","+a[2]));