Let ϕ ( n ) be the Euler phi function. If 1 ≤ n ≤ 1 0 0 0 , what is the smallest integer value of n that minimizes n ϕ ( n ) ?
You may choose to read Euler's theorem .
Details and Assumptions:
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.
The tricky part of this problem is to clearly explain how to arrive at the minimum. There are several ideas involved - 1) Having prime factors, 2) Having small prime factors, 3) Having numerous prime factors, 4) Having distinct prime factors.
When applied in the correct order, the proof flows directly and doesn't require consideration of numerous cases / separate arguments.
also try project Euler problem no.69 here http://www.mathblog.dk/project-euler-69-find-the-value-of-n-%E2%89%A4-1000000-for-which-n%CF%86n-is-a-maximum/
Damn!!i foolishly entered the highest one...840...and got it wrong 😢😢
31^2 = 961 gives 1/31 < 8/25
Let f ( n ) be the euler phi function for n to save on formatting. If a and b are coprime, f ( a ) f ( b ) = f ( a b ) . Also, note that f ( p k ) / ( p k ) = ( p − 1 ) / p for all prime p , and all positive integers k .
Thus if n is minimal s.t. f ( n ) / n is minimal, if we factor it into ( p 1 q 1 ) ∗ ( p 2 q 2 ) . . . ∗ ( p m q m ) , by the previous observation all q i are 1. Thus n = p 1 ∗ p 2 ∗ . . . ∗ p m (these primes are ordered p 1 < p 2 < . . . < p m ). Note that ( p − 1 ) / p is strictly increasing as p increases and is always less than 1; the former observation implies that there exists no prime q between p k and p k + 1 s.t. q is not in p i ; while the second observation implies that 1 0 0 0 < p 1 ∗ p 2 ∗ . . . ∗ p m ∗ q for any prime q > p m since the value of f ( n ∗ q ) / ( n ∗ q ) is smaller. Thus the answer is just 2 ∗ 3 ∗ 5 ∗ 7 = 2 1 0 .
While most knew that the answer must come from the product of several primes, they had difficulty justifying the following:
We want distinct prime factors, which follows because f ( p k ) / ( p k ) = ( p − 1 ) / p .
We want as many prime factors as possible, which follows since ( p − 1 ) p < 1 .
We want all the small prime factors first, which follows since ( p − 1 ) / p is strictly increasing.
It is easiest to do so in this order.
Other errors:
Be careful of your notation n = p 1 q 1 × p 2 q 2 × … is very different from n = p 1 q 1 + p 2 q 2 + … .
n almost certainly doesn't have n prime factors from p 1 to p n .
We factorize n such that: n = p 1 q 1 p 2 q 2 … p k q k , where p 1 , p 2 , … , p k are distinct prime factors of n and q 1 , q 2 , … , q k are positive integers. So, we have ϕ ( n ) = n ⋅ ( p 1 p 1 − 1 ) ( p 2 p 2 − 1 ) … ( p k p n − 1 ) . Thus n ϕ ( n ) = ( p 1 p 1 − 1 ) ( p 2 p 2 − 1 ) … ( p k p k − 1 ) . This implies that the value of n ϕ ( n ) is not dependent on the exponents of the prime factorization of n , hence to minimize it we set q 1 = q 2 = … = q k = 1 .
We have r r − 1 < s s − 1 ⇔ s 1 < r 1 ⇔ r < s . Thus this product is minimized by taking smallest k prime factors, and as many of them as possible. Hence we have n = 2 1 ⋅ 3 1 ⋅ 5 1 ⋅ 7 1 = 2 1 0 as the smallest possible value.
Euler's Phi Function is defined as followed: If n is a positive integer, phi(n) is the number of integers k, 1<=k<=n-1, such that (n, k)=1. The formula for phi(n) where n=p 1^e 1 + p 2^e^2 + . . . + p m^e m is (1-1/p 1) (1-1/p_2) . . . (1-1/p_m) n, where each p i are distinct and prime. Now, we see that phi(n)/n=(1-1/p 1) (1-1/p_2) . . .*(1-1/p m). To minimize this, we wish to have as many prime factors as possible in n to make the product smaller and smaller. Also, the factor (1-1/p i) is minimized when p_i is smaller. Choosing the most possible amount of the first consecutive primes (i.e. the smallest primes) for n while keeping n less than 1000, we find that n=2x3x5x7=210, our desired answer.
210= 2\times3 \times 5 \times 7 you might conjecture that for 1 \leq n \leq m , the value minimizing \frac {phi( n )}{ n } is the smallest primorial less than or equal to m .
This conjecture is in fact true and easy to prove if you know that \phi( n ) is multiplicative and when p is prime.
We can rewrite n ϕ ( n ) as p 1 ( p 1 − 1 ) p 2 ( p 2 − 1 ) . . . p k ( p k − 1 ) by the definition of the phi function, where p i are the prime factors of n .
Therefore, to minimize this, we just want to maximize the number of prime factors and put them as small as possible.
The maximum number of prime factors we can have is 4 if we choose 2, 3, 5, 7 so our number is 2 1 0 .
Note that if n = p 1 e 1 ⋯ p i e i is the prime factorization of n , then ϕ ( n ) = n ⋅ p 1 p 1 − 1 ⋯ p i p i − 1 . So if p ∣ n , then p n ϕ ( p n ) = n ϕ ( n ) . Hence the minimal n is a product of distinct primes. Also note that x x − 1 is a strictly increasing function, so we wish for the prime factors of n to be as small as possible. Some calculation yields n = 2 ⋅ 3 ⋅ 5 ⋅ 7 = 2 1 0 .
I'm not good at number theory, therefore python will save me xD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
The code takes some time to show the output though.
A very important idea here is that the number of different prime factors of a number less than or equal to 1000 is 4. If a natural number n less than or equal to 1000 had, for example, 5 different prime factors, then assuming that the prime factors are p 1 , p 2 , p 3 , p 4 , p 5 , given in an increasing order, we will have that p 1 ≥ 2 , p 2 ≥ 3 , p 3 ≥ 5 , p 4 ≥ 7 , p 5 ≥ 1 1 . Therefore, n ≥ p 1 p 2 p 3 p 4 p 5 ≥ 2 ∗ 3 ∗ 5 ∗ 7 ∗ 1 1 = 2 3 1 0 , that is contradiction. Now, we can find the minimum value of n ϕ ( n ) assuming that an expression of the form ( 1 − 1 / x ) is increasing for x > 0 , and, therefore, we can make the following conclusions. When n has only one prime factor the minimum value must be ( 1 − 1 / 2 ) = 1 / 2 . If n has two prime factors, then the minimum would be ( 1 − 1 / 2 ) ( 1 − 1 / 3 ) = 1 / 3 . For the case when n has three or four factors, the minimum values would be ( 1 − 1 / 2 ) ( 1 − 1 / 3 ) ( 1 − 1 / 5 ) = 4 / 1 5 or ( 1 − 1 / 2 ) ( 1 − 1 / 3 ) ( 1 − 1 / 5 ) ( 1 − 1 / 7 ) = 8 / 3 5 , respectively. Out of these four numbers the smallest is 8 / 3 5 . So the minimum is attained at a number n with prime factors 2 , 3 , 5 , 7 , and then the smallest possible value of n is 2 ∗ 3 ∗ 5 ∗ 7 = 2 1 0 .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
for n = 210 , 420 , 630, ... given ratio is minimized . Among them , 210 is the smallest n :)
If n = a 1 b 1 a 2 b 2 … a n b n , where a 1 a 2 … a n are primes and b 1 b 2 … b n are non-negative integers, ϕ ( n ) = ( a 1 − 1 ) a 1 b 1 − 1 ( a 2 − 1 ) a 2 b 2 − 1 … ( a n − 1 ) a n b n − 1 . Hence, n ϕ ( n ) = a 1 ( a 1 − 1 ) a 2 ( a 2 − 1 ) … a n ( a n − 1 ) . This implies that n ϕ ( n ) decreases as the number of prime divisors increases, and is the same regardless of the power of the prime factors. As such, we want to get as many primes as possible: 2 × 3 × 5 × 7 = 2 1 0 while 2 × 3 × 5 × 7 × 1 1 > 1 0 0 0 . Hence, n = 2 1 0 .
n ϕ ( n ) = n n × i = 2 ∑ n p p − 1
= ( p p − 1 ) ( p 2 p 2 − 1 ) . . . . . ( p n p n − 1 )
Here n is given to be least integer less than 1000, therefore we conclude each prime p divide n only one once
Second n = p × ( p 2 ) . . . . ( p n ) here n less than 1000
as p occurs only once therefore n = ( 2 ) ( 3 ) ( 5 ) ( 7 ) = 2 1 0 as if the next prime 11 is multiplied, n exceeds 1000. n = 2 1 0
[Student revision]
First , let us write n as n = p a × q b + … , where p,q… are prime numbers. The formula for calculating ϕ ( n ) is ϕ ( n ) = n ( 1 − 1 / p ) ( 1 − 1 / q ) + … .Putting both these values in our fraction , we get ϕ ( n ) / n = ( ( p − 1 ) / p × ( q − 1 ) / q + ( l d o t s . Rearranging the expression, (p-1)(q-1)+ ldots/)\(p^{a+1}\times q(b+1) + \ldots . Since we want the minimum the value of n less than 1000, we want the value of the numerator to be least and the denominator to be maximum. For the numerator to be minimum, all p,q,..., should be as small as possible, and as they are prime numbers, the should be 2,3,.... Now for the denominator to be maximum, let the values of a,b,... be 1. Now looking at prime numbers, the product of 2,3,5,7,11, exceeds 1000, therefore we will have to consider of the first four only which comes to be 210.
Problem Loading...
Note Loading...
Set Loading...
Given an integer N = p 1 q 1 p 2 q 2 . . . p n q n , ϕ N = N ( 1 − p 1 1 ) ( 1 − p 2 1 ) . . . ( 1 − p n 1 ) . Thus, N ϕ N = ( 1 − p 1 1 ) ( 1 − p 2 1 ) . . . ( 1 − p n 1 ) . Each of these expressions in the parentheses is less than one, so the more of these terms there are, the smaller their product will be. In addition, ( 1 − p i 1 ) will be closest to zero when p i is closest to one, so we want small prime factors. A number composed of small primes will have each term be smaller and allow more terms to fit before the number exceeds one thousand. Thus, we start with the first prime, two, and repeatedly multiply until we find the greatest number that is still under one thousand. This number turns out to be 2 × 3 × 5 × 7 = 2 1 0 , which has a totient quotient of 3 5 8 . 210 is also the smallest number that can get such a totient quotient, because it has exactly one of each prime factor. Any multiples of the number less than one thousand would be larger, but still have the same totient quotient because they still only have those four prime factors. Thus, the answer is 210.