dim a(9) for i=1to 1e4n=i while(n>0)a(mod(n,10))=1 n=int(n/10)wend for j=0to 9n=n+a(j) a(j)=0next if n=2?i next