+0

# Counting Question

0
51
2

How many odd 5-digit numbers can be formed using 1,2,3,4,5,6,7 each at most once, such that the hundreds digit is not 1?

How many 7 digit numbers have no repeating digits and 8 and 9 are not adjacent?

--------Thanks! Apr 2, 2020

#1
0

Apr 2, 2020
#2
+1

How many odd 5-digit numbers can be formed using 1,2,3,4,5,6,7 each at most once, such that the hundreds digit is not 1?

a=0;b=0;c=1;d=1;e=1;f=1;g=1;p=0; cycle:n=c*10000+d*1000+e*100+f*10+g; if(c!=d and c!=e and c!=f and f!=1 and c!=g and d!=e and d!=f and d!=g and e!=f and e!=g and f!=g and f!=1, goto loop, goto next);loop:printn,", ",;p=p+1; next:g++;if(g<8, goto cycle, 0);g=1;f++;if(f<8, goto cycle, 0);g=1;f=1;e++;if(e<8, goto cycle,0);g=1;f=1;e=1;d++;if(d<8, goto cycle,0);g=1;f=1;e=1;d=1;c++;if(c<8, goto cycle,0);g=1;f=1;e=1;d=1;c=1;b++;if(b==0, goto cycle,0);g=1;f=1;e=1;d=1;c=1;b=1;a++;if(a==0, goto cycle,0);print"Total = ",p

OUTPUT = 1,260 such numbers.

Apr 2, 2020
edited by Guest  Apr 2, 2020