Question: please use python based language: (a) Write a function num_primes_mod(n,a,b) that computes the number of primes pp less than nn with pamodbpamodb. For instance num_primes_mod(10,1,4)

please use python based language:

(a) Write a function num_primes_mod(n,a,b) that computes the number of primes pp less than nn with pamodbpamodb. For instance num_primes_mod(10,1,4) is 11, since 55 is the only prime less than 1010 that is congruent to 1mod41mod4. You can use any builtin functions, including next_prime.

(b) Use your function to compute: num_primes_mod(100,1,4), num_primes_mod(100,3,4), num_primes_mod(10^8,1,4), num_primes_mod(10^8,3,4).

(c) What pattern do you notice in (b)? Make a conjecture based on this pattern.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!