h={} 1.upto(1150){|n|s=0 1.upto(n){|x|s+=x if n%x<1} r=s/n.to_r p [h[r],n] if h[r] h[r]=n}
Standard input is empty
[6, 28] [30, 140] [80, 200] [40, 224] [12, 234] [84, 270] [66, 308] [78, 364] [102, 476] [28, 496] [114, 532] [240, 600] [138, 644] [120, 672] [150, 700] [174, 812] [135, 819] [186, 868] [864, 936] [222, 1036] [246, 1148]