N,d=1500,lambda n:sum(i for i in range(1,n) if n%i==0)print({i:d(i) for i in range(N+1) if i==d(d(i)) and i>d(i)})
Standard input is empty
{1210: 1184, 284: 220}
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!