a={}for i=1,3e3 do n=i r=i while(n>0)do r=r+n%10 n=.1*(n-n%10)end a[r]=1 d=a[i]or print(i)end