a=2;b=0;c=0;d=0;p=0; cycle:n=a*1000+b*100+c*10+d;if(a!=b and a!=c and a!=d and b!=c and b!=d and c!=d, goto loop, goto next); loop:printn," ",;p=p+1; next:d++;if(d<10, goto cycle, 0);d=0;c++;if(c<10, goto cycle, 0);d=0;c=0;b++;if(b<10, goto cycle,0);b=0;c=0;d=0;a++;if(a<7, goto cycle,0);print"Total = ",p
OUTPUT = 2,520 such numbers. Or: 6 x 9 x 8 x 7 =2,520 permutations