+0  
 
0
621
6
avatar

If integer C is randomly selected from 20 to 99, inclusive, what is the probability that C^3-C is divisible by 12?

 Feb 23, 2020
 #1
avatar
+1

a=20;i=1;c=(a^3 - a); if(c%12==0, goto4, goto6);printi,"-",a;i=i+1; a++;if(a<100, goto2, 0);print i
1 - 20
2 - 21
3 - 23
4 - 24
5 - 25
6 - 27
7 - 28
8 - 29
9 - 31
10 - 32
11 - 33
12 - 35
13 - 36
14 - 37
15 - 39
16 - 40
17 - 41
18 - 43
19 - 44
20 - 45
21 - 47
22 - 48
23 - 49
24 - 51
25 - 52
26 - 53
27 - 55
28 - 56
29 - 57
30 - 59
31 - 60
32 - 61
33 - 63
34 - 64
35 - 65
36 - 67
37 - 68
38 - 69
39 - 71
40 - 72
41 - 73
42 - 75
43 - 76
44 - 77
45 - 79
46 - 80
47 - 81
48 - 83
49 - 84
50 - 85
51 - 87
52 - 88
53 - 89
54 - 91
55 - 92
56 - 93
57 - 95
58 - 96
59 - 97
60 - 99
---------------

All the above 60 integers when expressed as: [C^3 - C] % 12=0
99 - 20 + 1=80
60 - 1 + 1 =60
The probability is: 60 / 80 =3 / 4

 Feb 23, 2020
 #4
avatar+118609 
0

Sorry Guest, I had contradicted you but I need to look again.   indecision

 Feb 23, 2020
 #5
avatar
+1

Hi Melody: I don't see any "bugs" in the code !. C=20. [20^3 - 20 =7980 mod 12 =0]......etc. Here are the results of all the 60 numbers that I have listed. Here is another short code taking them to "mod 12" and they all give "zero", which means they are ALL multiples of 12.

 

listforeach(n, d=(7980 , 9240 , 12144 , 13800 , 15600 , 19656 , 21924 , 24360 , 29760 , 32736 , 35904 , 42840 , 46620 , 50616 , 59280 , 63960 , 68880 , 79464 , 85140 , 91080 , 103776 , 110544 , 117600 , 132600 , 140556 , 148824 , 166320 , 175560 , 185136 , 205320 , 215940 , 226920 , 249984 , 262080 , 274560 , 300696 , 314364 , 328440 , 357840 , 373176 , 388944 , 421800 , 438900 , 456456 , 492960 , 511920 , 531360 , 571704 , 592620 , 614040 , 658416 , 681384 , 704880 , 753480 , 778596 , 804264 , 857280 , 884640 , 912576 , 970200), c=n%12) 

 

 

OUTPUT=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

 Feb 23, 2020
 #6
avatar+118609 
0

Yes, I already apologized.

I am also sorry if I caused you to waste your time with rechecking.

Melody  Feb 23, 2020

2 Online Users

avatar
avatar