Let S be the set of positive integers n such that each of n , n + 1 , n + 2 is a product of two different primes. Compute the product of the five smallest elements of S .
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.
Yeah a GIGANTIC but nice one !! , I'll try to rewrite a solution shorter than yours inspired from you .
Log in to reply
Please, if you can find a shorter and more elegant solution, I'd love to see how it works! Working with prime numbers is beautiful and yet a dreadful task... and I don't have a mathematical background as big as the big shots from this site, so just by being able to solve this problem makes me proud of myself haha. Good luck!
The numbers in question are :
n = 3 3 ( n = 3 × 1 1 ; n + 1 = 2 × 1 7 ; n + 2 = 5 × 7 )
n = 8 5 ( n = 5 × 1 7 ; n + 1 = 2 × 4 3 ; n + 2 = 3 × 2 9 )
n = 9 3 ( n = 3 × 3 1 ; n + 1 = 2 × 4 7 ; n + 2 = 5 × 1 9 )
n = 1 4 1 ( n = 3 × 4 7 ; n + 1 = 2 × 7 1 ; n + 2 = 1 1 × 1 3 )
n = 2 0 1 ( n = 3 × 6 7 ; n + 1 = 2 . 1 0 1 ; n + 2 = 7 × 2 9 ) .
I found this question in a book where solutions were not given, I'd love if someone else posts their solution !!!!
Well I got it wrong cos I accidentally left in n = 1 2 1 (which is of course 1 1 2 ) and thus got a smaller value for the answer.
But here's my corrected solution:
Observe that if n is even then n + 2 is also even. Note that the only even prime is 2 .
Therefore n and n + 2 each have a factor of 2 . Let the other factor of n be p = 2 (since the prime factors are required to be distinct) for some prime p and thus odd. So we have n = 2 p and n + 2 = 2 p + 2 = 2 ( p + 1 ) . Since p is odd, p + 1 must be even. But this means p + 1 = 2 and thus we have a contradiction.
We conclude that n must be odd, giving n + 1 to be the only even value of the three.
We have: n = 2 p − 1 n + 1 = 2 p n + 2 = 2 p + 1
Let S 5 be an empty set and P be the set of all prime numbers. Have p = p k be k t h element of P ∖ { 2 }
Step 1 : Let k = 1
Step 2 : If n is prime go to Step 7. Otherwise, continue to Step 3
Step 3 : If n has two distinct prime factors continue to Step 4. Otherwise go to Step 7.
Step 4 : If n + 2 is prime go to Step 7. Otherwise continue to Step 5
Step 5 : If n + 2 has two distinct prime factors append n to the set S 5 and continue to Step 6. Otherwise go to Step 7
Step 6 : If ∣ S 5 ∣ = 5 go to Step 8. Otherwise go to Step 7
Step 7 : Add 1 to the value of k and go to Step 2
Step 8 : Multiply together all elements of S 5
Log in to reply
Nice work Raph, it's clearer to me now that you've explained it STEP wise !!
Why such a "boring" answer? Even if you had read it in a book, then too, you could have just reduced it to 3 elements because the main motive should have been to understand the concept rather understand the calculation, I guess.
*I am surprised that there is not any programming approach here(though I used that one)
Log in to reply
Well it does seem boring but we need to prove that (yeah , I hate proofs but ) since this is a solution, we need to cover all aspects :)
@Kartik Sharma k Sharma, I posted one programming solution, is yours different?
Azhaghu Roopesh M people do methods, for this kind of questions, I do programs :P
img
Log in to reply
Yeah quite a bit same as my approach!
Coincidentally, I also called them 'Good'
What an idiot I am I computed the sum instead of the product .-.
Problem Loading...
Note Loading...
Set Loading...
Warning: Gigantic solution ahead. Brace yourselves...
Okay, so, first of all, it should be clear that n and n + 2 must have the same parity.
Case I : n is even.
If n is even, then so is n + 2 ; thus, n = 2 p 1 and n + 2 = 2 p 2 , where p 1 and p 2 are prime numbers.
From this, we can write: 2 p 2 − 2 p 1 = 2 , or p 2 − p 1 = 1 . This implies that both primes are consecutive, and thus p 1 = 2 and p 2 = 3 , which are the only possibilities; however, since 2 is already a factor of n , then this number is not the product of two distinct primes, so by contradiction n cannot be even.
Case I I : n is odd.
If n is odd, then so is n + 2 , and n + 1 is even. From this, we can write n + 1 = 2 p , where p is an odd prime number.
Now, we use a result that every prime greater than 4 modulo 6 is either 1 or 5 (The only numbers less than six which are coprime to it).
Thus, 2 p ≡ 2 ( m o d 6 ) or 2 p ≡ 1 0 ≡ 4 ( m o d 6 ) , so either n ≡ 1 ( m o d 6 ) or n ≡ 3 ( m o d 6 )
Now, if n = p 1 ∗ p 2 where p 1 and p 2 are primes, then we have two cases. WLOG, let's assume that p 1 < p 2 ;
Subcase 1 . 1 : p 1 = 3
We have that either p 2 ≡ 1 ( m o d 6 ) or p 2 ≡ 5 ( m o d 6 ) ; thus, n ≡ 3 ( m o d 6 ) or n ≡ 1 5 ≡ 3 ( m o d 6 ) ; in either case, if one of the factors of n is 3 , then n ≡ 3 ( m o d 6 ) ; also, n + 2 ≡ 5 ( m o d 6 )
Subcase 1 . 2 : p 1 = 3
Then, by reasoning similar to the one above, n ≡ 1 ( m o d 6 ) or n ≡ 5 ( m o d 6 ) ; due to the conditions set above, we can only have n ≡ 1 ( m o d 6 ) ; this can only happen when both primes leave the same remainder when divided by 6; this also implies that n + 2 ≡ 3 ( m o d 6 )
This proves that at least one of n and n + 2 is divisible by 3 . (Both are odd numbers, and the set of numbers ≡ 3 ( m o d 6 ) is ( 3 , 9 , 1 5 , … ) )
From here on, it's pretty much trial and error. Firstly we'll work with the case n = 3 q , and then later with the case n + 2 = 3 r , both q and r being prime numbers.
Subcase 2 . 1 : n = 3 q
q = 5 → n = 1 5 ; n + 1 = 1 6 = 2 t , where t is a prime number.
q = 7 → n = 2 1 ; n + 1 = 2 2 = 2 ∗ 1 1 ; n + 2 = 2 3 = p i ∗ p j , which is not a valid solution.
q = 1 1 → n = 3 3 ; n + 1 = 3 4 = 2 ∗ 1 7 ; n + 2 = 3 5 = 5 ∗ 7 ; n = 3 3 is a valid member of the set.
q = 1 3 → n = 3 9 ; n + 1 = 4 0 = 2 ∗ t , where t is a prime number.
q = 1 7 → n = 5 1 ; n + 1 = 5 2 = 2 2 ∗ 1 3 = 2 ∗ t , where t is a prime number.
q = 1 9 → n = 5 7 ; n + 1 = 5 8 = 2 ∗ 2 9 ; n + 2 = 5 9 = p i ∗ p j , which is not a valid solution
q = 2 3 → n = 6 9 ; n + 1 = 7 0 = 2 ∗ 5 ∗ 7 = 2 ∗ t , where t is a prime number.
q = 2 9 → n = 8 7 ; n + 1 = 8 8 = 2 3 ∗ 1 1 = 2 ∗ t , where t is a prime number.
q = 3 1 → n = 9 3 ; n + 1 = 9 4 = 2 ∗ 4 7 ; n + 2 = 9 5 = 5 ∗ 1 9 ; n = 9 3 is a valid member of the set.
q = 3 7 → n = 1 1 1 ; n + 1 = 1 1 2 = 2 4 ∗ 7 = 2 ∗ t , where t is a prime number
q = 4 1 → n = 1 2 3 ; n + 1 = 1 2 4 = 2 2 ∗ 3 1 = 2 ∗ t ,where t is a prime number
q = 4 3 → n = 1 2 9 ; n + 1 = 1 3 0 = 2 ∗ 5 ∗ 1 3 = 2 ∗ t , where t is a prime number
q = 4 7 → n = 1 4 1 ; n + 1 = 1 4 2 = 2 ∗ 7 1 ; n + 2 = 1 4 3 = 1 1 ∗ 1 3 ; n = 1 4 1 is a valid member of the set.
q = 5 3 → n = 1 5 9 ; n + 1 = 1 6 0 = 2 5 ∗ 5 = 2 ∗ t , where t is a prime number
q = 5 9 → n = 1 7 7 ; n + 1 = 1 7 8 = 2 ∗ 8 9 ; n + 2 = 1 7 9 is a prime number
q = 6 1 → n = 1 8 3 ; n + 1 = 1 8 4 = 2 3 ∗ 2 3 = 2 ∗ t , where t is a prime number
q = 6 7 → n = 2 0 1 ; n + 1 = 2 0 2 = 2 ∗ 1 0 1 ; n + 2 = 2 0 3 = 7 ∗ 2 9 ; n = 2 0 1 is a valid member of the set
And so on...
Subcase 2 . 2 : n + 2 = 3 r
q = 5 → n = 1 3 ; n is not the product of two distinct prime numbers
q = 7 → n = 1 9 ; n is not the product of two distinct prime numbers
q = 1 1 → n = 3 1 ; n is not the product of two distinct prime numbers
q = 1 3 → n = 3 7 ; n is not the product of two distinct prime numbers
q = 1 7 → n = 4 9 = 7 2 ; n is not the product of two distinct prime numbers
q = 1 9 → n = 5 5 = 5 ∗ 1 1 ; n + 1 = 5 6 = 2 3 ∗ 7 = 2 ∗ t , where t is a prime number
q = 2 3 → n = 6 7 ; n is not the product of two distinct prime numbers
q = 2 9 → n = 8 5 = 5 ∗ 1 7 ; n + 1 = 8 6 = 2 ∗ 4 3 ; n + 2 = 8 7 = 3 ∗ 2 9 ; n = 8 5 is a valid member of the set.
q = 3 1 → n = 9 1 = 7 ∗ 1 3 ; n + 1 = 9 2 = 2 2 ∗ 2 3 = 2 ∗ t , where t is a prime number
q = 3 7 → n = 1 0 9 ; n + 1 = 1 1 0 = 2 ∗ 5 ∗ 1 1 = 2 ∗ t , where t is a prime number
q = 4 1 → n = 1 2 1 = 1 1 2 ; n is not the product of two distinct prime numbers
q = 4 3 → n = 1 2 7 ; n is not the product of two distinct prime numbers
q = 4 7 → n = 1 3 9 ; n is not the product of two distinct prime numbers
q = 5 3 → n = 1 5 7 ; n is a prime number.
q = 5 9 → n = 1 7 5 = 5 2 ∗ 7 ; n is not the product of two distinct prime numbers
q = 6 1 → n = 1 8 1 ; n is a prime number
q = 6 7 → n = 1 9 9 ; n is a prime number
And so on...
The first members of the set S are: ( 3 3 , 8 5 , 9 3 , 1 4 1 , 2 0 1 , … ) ; thus, the product sought is 3 3 ∗ 8 5 ∗ 9 3 ∗ 1 4 1 ∗ 2 0 1 = 7 3 9 3 1 7 4 9 6 5