Find the smallest number (>1) and the largest number (<n) that is relatively prime to n,
where n equals:
i. 21
ii. 420
iii. 90
Answers
Answer:
Two numbers are relative prime if their greatest common divisor is 1, that is gcd(n,a). We can also find no of elements that are relative prime to given number by Euler function.
How can I find a number suppose 'a' that is relative prime to my given number let's say 'n' and is smaller than 'n'? Ideally I want smallest number that is relative prime to n except 1.
Step-by-step explanation:
Excluding 1, the smallest number that is relative prime to n is the smallest prime number not dividing n.
Primes are : 2,3,5,7,…. You can check divisibility of n by 2 if it's not divisible then a=2 if it is then try 3,5 etc. Or you can find the product of primes that compose n and pick the smallest prime not included. (this is if you don't want the number 1)