Question: Consider the odd primes 3, 5, 7, 11, 13, 17, 19, etc. Let S be the odd primes congruent to 1 mod 4 and

Consider the odd primes 3, 5, 7, 11, 13, 17, 19, etc.

Consider the odd primes 3, 5, 7, 11, 13, 17, 19, etc. Let S be the odd primes congruent to 1 mod 4 and T be the odd primes congruent to 3 mod 4. So S=5, 13, 17, 29, etc. and T = 3, 7, 11, 19, 23, etc. - Suppose we go through the odd primes in order counting the number of primes in S and T. So at the first step S = { } and T = {3} so T has more primes than S. At the second step S = {5} and T = {3} so S and T have the same number of primes. At the third step S = {5} and T = {3,7} so T has more primes than S again. Here is a little table counting the size of S and T for the first 10 primes Prime 3 |0 1 |S| ||T| 5 1 1 7 1 2 11 1 3 13 2 3 17 3 3 19 3 4 23 3 5 29 4 5 31 4 6 Notice that |T| |S| for the first 10 primes. Does it ever happen that |S||T| ? Yes, it does. When? How often? Using the builtin nextprime command write a loop that counts |S| and |T| for primes up to 10^6 and prints out the the first time |S| >|T| and, at the end, how often |S| >|T|.

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Notice that T S for the first 10 pr imes Does it ever happen that S T Yes it does When How often ANS ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!