How many five-digit integers are multiple of 3, or multiples of 5, or both?
Between 10,000 and 99,999 there are 42,000 numbers that are either multiples of 3, or multiples of 5, or multiples of 15.
a=1;b=0;c=0;d=0;e=0;p=0; cycle:n= a*10000+b*1000+c*100+d*10+e;if(n%3==0 or n%5==0 or n%15==0, goto loop, goto next); loop:printn,", ",;p=p+1; next:e++;if(e<10, goto cycle, 0);e=0;d++;if(d<10, goto cycle, 0);e=0;d=0;c++;if(c<10, goto cycle,0);c=0;d=0;e=0;b++;if(b<10, goto cycle,0);e=0;d=0;c=0;b=0;a++;if(a<10, goto cycle,0);print"Total = ",p
OUTPUT = 42,000 such numbers.