+0  
 
0
76
4
avatar+212 

(deleted)

 Apr 24, 2020
edited by somehelpplease  May 8, 2020
 #1
avatar
+2

a=1;c=0; d=gcd(a, 15);if(d==3, goto4, goto6);c++;printc,"-","GCD of",a,"and", "15","=",d;a++;if(a<100, goto2, 0)

 

OUTPUT:
1 - GCD of 3 and 15 = 3
2 - GCD of 6 and 15 = 3
3 - GCD of 9 and 15 = 3
4 - GCD of 12 and 15 = 3
5 - GCD of 18 and 15 = 3
6 - GCD of 21 and 15 = 3
7 - GCD of 24 and 15 = 3
8 - GCD of 27 and 15 = 3
9 - GCD of 33 and 15 = 3
10 - GCD of 36 and 15 = 3
11 - GCD of 39 and 15 = 3
12 - GCD of 42 and 15 = 3
13 - GCD of 48 and 15 = 3
14 - GCD of 51 and 15 = 3
15 - GCD of 54 and 15 = 3
16 - GCD of 57 and 15 = 3
17 - GCD of 63 and 15 = 3
18 - GCD of 66 and 15 = 3
19 - GCD of 69 and 15 = 3
20 - GCD of 72 and 15 = 3
21 - GCD of 78 and 15 = 3
22 - GCD of 81 and 15 = 3
23 - GCD of 84 and 15 = 3
24 - GCD of 87 and 15 = 3
25 - GCD of 93 and 15 = 3
26 - GCD of 96 and 15 = 3
27 - GCD of 99 and 15 = 3

 Apr 24, 2020
 #2
avatar+212 
+2

Thank you!

somehelpplease  Apr 25, 2020
 #3
avatar+109527 
+2

For how many integers n between 1 and 100 is the greatest common divisor of 15 and n equal to 3?

 

15=3*5

So all the numbers we want are 3*N where N is not a multiple of 5

 

100/3 =33 and a bit

so there are 33 multiples of 3

there are 6 multiples of 15 we do not want those.

 

33-6 = 27

 Apr 25, 2020
 #4
avatar+212 
+1

Thanks Melody! I really appreciate that you worked it out. Have a good day :D

somehelpplease  Apr 27, 2020

14 Online Users