3.upto(?d){|a|3.upto(4901){|b|c=Math.hypot a,b puts"#{a} #{b} %d"%c if c.modulo(1)==0}}