Question: please use python to code Problem 3 We say that two integers a, b are relatively prime if gcd(a, b) = 1 (or equivalently, they

please use python to code Problem 3 We say that two integersplease use python to code

Problem 3 We say that two integers a, b are relatively prime if gcd(a, b) = 1 (or equivalently, they share no common prime factor). Write a function num_rel_prime (n) that returns the number of positive integers less than n that are relatively prime to n (where n is any positive integer). For instance, num_rel_prime (6) should return 2, since 1,5 are the positive integers less than 6 that are relatively prime to it. Compute num_rel_prime(n) for n = 7, 11, 13, 17, 19, 23,4,9, 25, 49, 12, 18, 20, 50. Based on these experiments and any more that you find useful, guess a general formula for num_rel_prime (n) in terms of the prime factorization of n

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!