+0  
 
0
43
3
avatar

How many numbers between 2000 and 7000 consist of four different digits?

 May 9, 2020
 #1
avatar
+1

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

 May 10, 2020
 #3
avatar+109519 
+1

6*9*8*7 is not equal to that.  Can you see why that is wrong?

Melody  May 10, 2020
 #2
avatar+109519 
+1

How many numbers between 2000 and 7000 consist of four different digits?

 

5*9*8*7 = 2520

 May 10, 2020

26 Online Users

avatar
avatar