Find the number of pairs of coprime integers ( n , m ) such that 1 ≤ n ≤ m ≤ 2 0 .
Details and assumptions
2 integers are coprime if their greatest common divisor is 1.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Can you elaborate on "This sum follows readily from the definition of ϕ "?
In other words, how did you calculate the sum?
Log in to reply
I meant that the actual statement of the sum follows readily from the definition of ϕ , not that the actual VALUE of the sum follows from ϕ . Sorry for the confusion. Unfortunately, I don't think there's an easy way to calculate such a sum - I just used MATLAB to get the actual value.
What about Farey's sequence?
Log in to reply
Forgive my (semi) ignorance, but isn't the Farey sequence calculated very similarly to this? If I recall, the number of terms in the Farey sequence for some n is ∑ i = 1 n ϕ ( n ) (I could be wrong!).
For the curious, the Farey sequence for some n is defined as an ordered sequence of all rational numbers b a such that 0 ≤ a ≤ b ≤ n and g c d ( a , b ) = 1 .
Let g cd ( n , m ) = d . First, assume n = m .
Let us consider the non-coprime pairs of positive integers.
If 2 ∣ d , then m , n ∈ 2 , 4 , ⋯ , 2 0 . There are ( 2 1 0 ) = 4 5 possible ways this can happen. If 3 ∣ d , then m , n ∈ 3 , 6 , ⋯ , 1 8 . There are ( 2 6 ) = 1 5 possible ways this can happen. If 5 ∣ d , then m , n ∈ 5 , 1 0 , 1 5 , 2 0 . There are ( 2 4 ) = 6 possible ways this can happen. If 7 ∣ d , then m , n ∈ 7 , 1 4 . There is 1 way this can happen. And if none of these hold, d must divide a prime above 7 , but no two distinct numbers from 1 to 2 0 share a prime factor above 7 .
Now we account for overcounts. If 2 ∣ d and 3 ∣ d , then 6 ∣ d , so m , n ∈ 6 , 1 2 , 1 8 . There are ( 2 3 ) = 3 ways this can happen. If 2 ∣ d and 5 ∣ d , then 1 0 ∣ d , so m , n ∈ 1 0 , 2 0 . There is only one way this can happen. If 2 ∣ d and 7 ∣ d , then 1 4 ∣ d , which is impossible. If 3 ∣ d and 5 ∣ d , then 1 5 ∣ d , which is impossible. If 3 ∣ d and 7 ∣ d , then 2 1 ∣ d , which is impossible. If 5 ∣ d and 7 ∣ d , then 3 5 ∣ d , which is impossible. Also, we can notice that no three of these conditions can simultaneously occur. Therefore, the complement of our answer is 4 5 + 1 5 + 6 + 1 − 3 − 1 = 6 3 .
The total number of ways we can choose m , n is ( 2 2 0 ) = 1 9 0 . Therefore, we 1 9 0 − 6 3 = 1 2 7
However, at the beginning we said n = m . Now when n = m , we get d = n = m = 1 , so we have to add another solution, bringing our total to the final answer 1 2 8
In number theory, Euler's totient or phi function, φ(n) is an arithmetic function that counts the number of positive integers less than or equal to n that are relatively prime to n. There are several formulae for the totient. Euler's product formula states: φ(n)=n* Π(1-1/p), where the product is over the distinct prime numbers dividing n. In our problem we have to count φ(1)+ φ(2)+...+φ(20). Using Euler's product formula we get our result.
for 1 all the numbers will be co prime to it.so it counts to 20. for 2 all odd numbers will be co prime.so 20/2=10. for 3 all nos not divisible by 3.17-(17/3)=9 for 4 all odd numbers will be co prime. so (20- 4)-(16/4). and going on like that.
make a chart of all co prime which satisfies the above relation and then count the no. of co prime and you will get the answer.
> We denote A i as the set comprises of pairs of intergers ( n , m ) which sastify that : 1 ≤ n ≤ m ≤ 2 0 ; i ∣ g c d ( n , m ) . > Thus, since { n ∣ 1 ≤ n ≤ 2 0 ; i ∣ n } = [ i 2 0 ] ( i is an positive integer), we imply that: ∣ A i ∣ = 2 [ 2 0 / i ] ( [ 2 0 / i ] + 1 ) (1) > On the other hands, we have that: { ( n , m ) ∣ 1 < g c d ( n , m ) ; 1 ≤ n ≤ m ≤ 2 0 } = ∪ p ∈ P ; p < 2 0 A p > According to Inclusion-Exclusion principle ,we have: ∣ ∪ p ∈ P ; p < 2 0 A p ∣ = ( ∑ p ∈ P , p < 2 0 ∣ A p ∣ ) −
( ∑ p < q ; p , q ∈ P ; p , q < 2 0 ∣ A p ∩ A q ∣ ) = 8 2 [ according to (1) ]
And there are 2 1 0 pairs of integers ( n , m ) which sastify that: 1 ≤ n ≤ m ≤ 2 0 Hence, 2 1 0 − 8 2 = 1 2 8 is our desired number
One way to go about answering this question is by creating a list of numbers and then counting how many pairs there are.
The first list is the numbers 1 to 20.
For all 1 ≤ n ≤ 2 0 you can count the number of possibilities for m, keeping in mind n and m are coprime and that n ≤ m ≤ 2 0
You'll get something like this:
n = 1 , ∣ M ∣ = 2 0
n = 2 , ∣ M ∣ = 9
n = 3 , ∣ M ∣ = 1 2
n = 4 , ∣ M ∣ = 8
n = 5 , ∣ M ∣ = 1 2
n = 6 , ∣ M ∣ = 5
n = 7 , ∣ M ∣ = 1 2
n = 8 , ∣ M ∣ = 6
n = 9 , ∣ M ∣ = 8
n = 1 0 , ∣ M ∣ = 4
n = 1 1 , ∣ M ∣ = 9
n = 1 2 , ∣ M ∣ = 3
n = 1 3 , ∣ M ∣ = 7
n = 1 4 , ∣ M ∣ = 3
n = 1 5 , ∣ M ∣ = 3
n = 1 6 , ∣ M ∣ = 2
n = 1 7 , ∣ M ∣ = 3
n = 1 8 , ∣ M ∣ = 1
n = 1 9 , ∣ M ∣ = 1
n = 2 0 , ∣ M ∣ = 0
Where ∣ M ∣ is the cardinality of the set of M, or in other words the number of elements in M, and M is the set of possible values of m for that value of n.
Important things to keep in mind when compiling this list are the patterns on numbers like primes and various multiples, with the exception of 1. Then, you add up the numbers and get:
2 0 + 9 + 1 2 + 8 + 1 2 + 5 + 1 2 + 6 + 8 = 9 2
9 2 + 4 + 9 + 3 + 7 + 3 + 3 + 2 + 3 + 1 + 1 + 0 = 1 2 8
[Split up so that the adding doesn't go off the page]
And so 128 is the answer.
m = 2 0 ⟹ n = 1 , 2 , . . . , 2 0 → 2 0 choices m = 1 9 ⟹ n = 1 , 2 , . . . , 1 9 → 1 9 choices .
.
.
m = 1 ⟹ n = 1 → 1 choice
Total = 1 + 2 + . . . + 2 0 = 2 1 0 .
We find all pairs with g c d > 1 :
2 → 2 , 4 , 6 , . . . , 2 0 = 1 0 choices
3 → 3 , 6 , 9 , . . , 1 8 = 6 choices
.
( Similarly we can calculate for all numbers )
.
2 0 → 2 0 = 1 choice.
Total = 1 0 + 6 + . . . + 1 = 8 2 .
So required number = 1 2 8 .
i = 1 ∑ 2 0 ϕ ( i ) = 1 2 8
How did you calcul this sum? Did you calcul the functions one by one ?
Log in to reply
i did
https://oeis.org/wiki/Euler%27s totient function
I am using wolfram alfa... :D
why not python?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Euler Totient Fuction, denoted as φ ( m ) , is a function that takes any integer, and gives the amount of integers less than or equal to m that are coprime to it.
We have 1 < = n < = m < = 2 0 and if n=m, the greatest common divisor is not 1. Thus, can set m equal to each of the integers from 1 to 20, since for each phi(n)=k, k<=n (Equality when n=1) By direct calculation, the number of pairs is, phi(20)+phi(19)+phi(18)....phi(1)=128
Sum up the results of Euler's Totient function when operated on integers ranging from 1 to 20. This will give the result.
The totient function when operated on a number "n" gives the total count of numbers those are less than and coprime to "n".
This function is defined as
f ( n ) = n ∏ i = 1 k (1-1/ p i ) where f(n) is the totient function, "n" is the number in context for which the coprime count less than that needs to be computed and p 1 , p 2 , … , p k are the prime factors of the number "n".
Eg: f ( 2 0 ) = 2 0 ( 1 − 1 / 2 ) ( 1 − 1 / 5 ) = 8
Hence the solution is ∑ n = 1 N f ( n ) , in this case N = 2 0 this would yield a result of 1 2 8 .
φ ( m ) = number of positive integers less than n that are relatively prime to n. (1). phi(p) where p is prime = p-1 (2). phi is multiplicative, so if n= i.j and gcd(i,j)=1, then phi(n) = phi(i). phi(j) (3). phi(p^k) where p is a prime = (p^(k-1)). (p-1) Now, 1...20 has 8 primes (2,3,5,7,11,13,17,19). phi(n) for them can be computed using (1) For the rest, formula (2) and (3) can be used. Also phi(1) =1. Then we need to sum up all phi(n), n ranging from 1 to 20. and we will get the answer.
The number of n which is coprime to m is φ ( m ) . So, to get the result we need only count ∑ m = 1 2 0 φ ( m ) . To find φ ( m ) , we can either list them (since it's not really a brute force) or use the Euler's product formula: φ ( m ) = m p ∥ m ∏ ( 1 − p 1 ) where p 's are prime factors of m and φ ( 1 ) = 1 .
So, φ ( 1 ) = 1 , φ ( 2 ) = 1 , φ ( 3 ) = 2 , φ ( 4 ) = 2 , φ ( 5 ) = 4 , φ ( 6 ) = 2 , φ ( 7 ) = 6 , φ ( 8 ) = 4 , φ ( 9 ) = 6 , φ ( 1 0 ) = 4 , φ ( 1 1 ) = 1 0 , φ ( 1 2 ) = 4 , φ ( 1 3 ) = 1 2 , φ ( 1 4 ) = 6 , φ ( 1 5 ) = 8 , φ ( 1 6 ) = 8 , φ ( 1 7 ) = 1 6 , φ ( 1 8 ) = 6 , φ ( 1 9 ) = 1 8 , φ ( 2 0 ) = 8 .
So, summing it all up giving us 1 2 8 .
Problem Loading...
Note Loading...
Set Loading...
Simply enough, ∑ n = 1 2 0 ϕ ( n ) = 1 2 8 , where ϕ ( n ) is Euler's totient function. This sum follows readily from the definition of ϕ .