1. Find the ratio of the number of prime numbers to the number of composite numbers between the numbers 1 and 20
Answers
Answered by
0
Find the first 10 primes, and store them in p:
]p=.p:i.10
2 3 5 7 11 13 17 19 23 29
Count the primes in the range 2 - 25:
+/p e.~ 2 to 25
9
Count the non-primes in the range 2–25:
+/-.p e.~ 2 to 25
15
So the ratio is 9/15 or 3/5.
]p=.p:i.10
2 3 5 7 11 13 17 19 23 29
Count the primes in the range 2 - 25:
+/p e.~ 2 to 25
9
Count the non-primes in the range 2–25:
+/-.p e.~ 2 to 25
15
So the ratio is 9/15 or 3/5.
Answered by
1
Answer:
4:5 or 4/5 will be the answer.
Similar questions