def M(n): x=bin(int(n))[2:] s=0 for i in range(1,len(x)): if x[i-1]=="1" and x[i]=="0": s+=i return s def sigma(n): s=0 for i in range(1,n+1): if n%i==0: s+=i return s def a(n): return M(sigma(n)) for i in range(1,10001): print str(i)+" "+str(a(i))