+0  
 
0
345
1
avatar

How many ways are there to create a 6 digit pin number where exactly 4 of digits are the same? the numbers 0-9 can be in any place

 Mar 4, 2020
 #1
avatar
0

n=0;p=0;cycle: a=(100000+n);b=int(a/100000);c=int(a/10000)%10;d=int(a/1000)%10;e=int(a/100)%10;f=int(a/10)%10;g=a%10;n=n+1;if(b==c and b==d and b==e or c==d and c==e and c==f or d==e and d==f and d==g or e==f and e==g and e==b or f==g and f==b and f==c or g==b and g==c and g==d, goto loop,goto cycle);loop:p=p+1;printa,", ",;if(n<=899999, goto cycle, 0);print"Total = ",p

 

OUTPUT =4,905 such numbers.

Note: Melody, CPhill, EP........Guys, see if you can verify this number mathematically !!. Thanks.

 Mar 5, 2020

4 Online Users

avatar
avatar
avatar