Nice Number Theory

Let S S be the set of positive integers n n such that each of n , n + 1 , n + 2 n, n+1, n+2 is a product of two different primes. Compute the product of the five smallest elements of S S .


The answer is 7393174965.

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.

2 solutions

Warning: Gigantic solution ahead. Brace yourselves...

Okay, so, first of all, it should be clear that n n and n + 2 n + 2 must have the same parity.

Case I I : n n is even.

If n n is even, then so is n + 2 n + 2 ; thus, n = 2 p 1 n = 2p_{1} and n + 2 = 2 p 2 n + 2 = 2p_{2} , where p 1 p_{1} and p 2 p_{2} are prime numbers.

From this, we can write: 2 p 2 2 p 1 = 2 2p_{2} - 2p_{1} = 2 , or p 2 p 1 = 1 p_{2} - p_{1} = 1 . This implies that both primes are consecutive, and thus p 1 = 2 p_{1} = 2 and p 2 = 3 p_{2} = 3 , which are the only possibilities; however, since 2 2 is already a factor of n n , then this number is not the product of two distinct primes, so by contradiction n cannot be even.

Case I I II : n n is odd.

If n n is odd, then so is n + 2 n + 2 , and n + 1 n + 1 is even. From this, we can write n + 1 = 2 p n + 1 = 2p , where p p is an odd prime number.

Now, we use a result that every prime greater than 4 modulo 6 6 is either 1 1 or 5 5 (The only numbers less than six which are coprime to it).

Thus, 2 p 2 ( m o d 6 ) 2p \equiv 2 \pmod{6} or 2 p 10 4 ( m o d 6 ) 2p \equiv 10 \equiv 4 \pmod{6} , so either n 1 ( m o d 6 ) n \equiv 1 \pmod{6} or n 3 ( m o d 6 ) n \equiv 3 \pmod{6}

Now, if n = p 1 p 2 n = p_{1}*p_{2} where p 1 p_{1} and p 2 p_{2} are primes, then we have two cases. WLOG, let's assume that p 1 < p 2 p_{1} < p_{2} ;

Subcase 1.1 1.1 : p 1 = 3 p_{1} = 3

We have that either p 2 1 ( m o d 6 ) p_{2} \equiv 1 \pmod{6} or p 2 5 ( m o d 6 ) p_{2} \equiv 5 \pmod{6} ; thus, n 3 ( m o d 6 ) n \equiv 3 \pmod{6} or n 15 3 ( m o d 6 ) n \equiv 15 \equiv 3 \pmod{6} ; in either case, if one of the factors of n n is 3 3 , then n 3 ( m o d 6 ) n \equiv 3 \pmod{6} ; also, n + 2 5 ( m o d 6 ) n + 2 \equiv 5 \pmod{6}

Subcase 1.2 1.2 : p 1 3 p_{1} \neq 3

Then, by reasoning similar to the one above, n 1 ( m o d 6 ) n \equiv 1 \pmod{6} or n 5 ( m o d 6 ) n \equiv 5 \pmod{6} ; due to the conditions set above, we can only have n 1 ( m o d 6 ) n \equiv 1 \pmod{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 ) n + 2 \equiv 3 \pmod{6}

This proves that at least one of n n and n + 2 n + 2 is divisible by 3 3 . (Both are odd numbers, and the set of numbers 3 ( m o d 6 ) \equiv 3 \pmod{6} is ( 3 , 9 , 15 , ) (3, 9, 15, \ldots) )

From here on, it's pretty much trial and error. Firstly we'll work with the case n = 3 q n = 3q , and then later with the case n + 2 = 3 r n + 2 = 3r , both q and r being prime numbers.

Subcase 2.1 2.1 : n = 3 q n = 3q

q = 5 n = 15 q = 5 \rightarrow n = 15 ; n + 1 = 16 2 t n + 1 = 16 \neq 2t , where t t is a prime number.

q = 7 n = 21 q = 7 \rightarrow n = 21 ; n + 1 = 22 = 2 11 n + 1 = 22 = 2*11 ; n + 2 = 23 p i p j n + 2 = 23 \neq p_{i}*p_{j} , which is not a valid solution.

q = 11 n = 33 q = 11 \rightarrow n = 33 ; n + 1 = 34 = 2 17 n + 1 = 34 = 2*17 ; n + 2 = 35 = 5 7 n + 2 = 35 = 5*7 ; n = 33 n = 33 is a valid member of the set.

q = 13 n = 39 q = 13 \rightarrow n = 39 ; n + 1 = 40 2 t n + 1 = 40 \neq 2*t , where t t is a prime number.

q = 17 n = 51 q = 17 \rightarrow n = 51 ; n + 1 = 52 = 2 2 13 2 t n + 1 = 52 = 2^{2}*13 \neq 2*t , where t t is a prime number.

q = 19 n = 57 q = 19 \rightarrow n = 57 ; n + 1 = 58 = 2 29 n + 1 = 58 = 2*29 ; n + 2 = 59 p i p j n + 2 = 59 \neq p_{i}*p_{j} , which is not a valid solution

q = 23 n = 69 q = 23 \rightarrow n = 69 ; n + 1 = 70 = 2 5 7 2 t n + 1 = 70 = 2*5*7 \neq 2*t , where t t is a prime number.

q = 29 n = 87 q = 29 \rightarrow n = 87 ; n + 1 = 88 = 2 3 11 2 t n + 1 = 88 = 2^{3}*11 \neq 2*t , where t t is a prime number.

q = 31 n = 93 q = 31 \rightarrow n = 93 ; n + 1 = 94 = 2 47 n + 1 = 94 = 2*47 ; n + 2 = 95 = 5 19 n + 2 = 95 = 5*19 ; n = 93 n = 93 is a valid member of the set.

q = 37 n = 111 q = 37 \rightarrow n = 111 ; n + 1 = 112 = 2 4 7 2 t n + 1 = 112 = 2^{4}*7 \neq 2*t , where t t is a prime number

q = 41 n = 123 q = 41 \rightarrow n = 123 ; n + 1 = 124 = 2 2 31 2 t n + 1 = 124 = 2^{2}*31 \neq 2*t ,where t t is a prime number

q = 43 n = 129 q = 43 \rightarrow n = 129 ; n + 1 = 130 = 2 5 13 2 t n + 1 = 130 = 2*5*13 \neq 2*t , where t t is a prime number

q = 47 n = 141 q = 47 \rightarrow n = 141 ; n + 1 = 142 = 2 71 n + 1 = 142 = 2*71 ; n + 2 = 143 = 11 13 n + 2 = 143 = 11*13 ; n = 141 n = 141 is a valid member of the set.

q = 53 n = 159 q = 53 \rightarrow n = 159 ; n + 1 = 160 = 2 5 5 2 t n + 1 = 160 = 2^{5}*5 \neq 2*t , where t t is a prime number

q = 59 n = 177 q = 59 \rightarrow n = 177 ; n + 1 = 178 = 2 89 n + 1 = 178 = 2*89 ; n + 2 = 179 n + 2 = 179 is a prime number

q = 61 n = 183 q = 61 \rightarrow n = 183 ; n + 1 = 184 = 2 3 23 2 t n + 1 = 184 = 2^{3}*23 \neq 2*t , where t t is a prime number

q = 67 n = 201 q = 67 \rightarrow n = 201 ; n + 1 = 202 = 2 101 n + 1 = 202 = 2*101 ; n + 2 = 203 = 7 29 n + 2 = 203 = 7*29 ; n = 201 n = 201 is a valid member of the set

And so on...

Subcase 2.2 2.2 : n + 2 = 3 r n + 2 = 3r

q = 5 n = 13 q = 5 \rightarrow n = 13 ; n n is not the product of two distinct prime numbers

q = 7 n = 19 q = 7 \rightarrow n = 19 ; n n is not the product of two distinct prime numbers

q = 11 n = 31 q = 11 \rightarrow n = 31 ; n n is not the product of two distinct prime numbers

q = 13 n = 37 q = 13 \rightarrow n = 37 ; n n is not the product of two distinct prime numbers

q = 17 n = 49 = 7 2 q = 17 \rightarrow n = 49 = 7^{2} ; n n is not the product of two distinct prime numbers

q = 19 n = 55 = 5 11 q = 19 \rightarrow n = 55 = 5*11 ; n + 1 = 56 = 2 3 7 2 t n + 1 = 56 = 2^{3}*7 \neq 2*t , where t t is a prime number

q = 23 n = 67 q = 23 \rightarrow n = 67 ; n n is not the product of two distinct prime numbers

q = 29 n = 85 = 5 17 q = 29 \rightarrow n = 85 = 5*17 ; n + 1 = 86 = 2 43 n + 1 = 86 = 2*43 ; n + 2 = 87 = 3 29 n + 2 = 87 = 3*29 ; n = 85 n = 85 is a valid member of the set.

q = 31 n = 91 = 7 13 q = 31 \rightarrow n = 91 = 7*13 ; n + 1 = 92 = 2 2 23 2 t n + 1 = 92 = 2^{2}*23 \neq 2*t , where t t is a prime number

q = 37 n = 109 q = 37 \rightarrow n = 109 ; n + 1 = 110 = 2 5 11 2 t n + 1 = 110 = 2*5*11 \neq 2*t , where t t is a prime number

q = 41 n = 121 = 1 1 2 q = 41 \rightarrow n = 121 = 11^{2} ; n n is not the product of two distinct prime numbers

q = 43 n = 127 q = 43 \rightarrow n = 127 ; n n is not the product of two distinct prime numbers

q = 47 n = 139 q = 47 \rightarrow n = 139 ; n n is not the product of two distinct prime numbers

q = 53 n = 157 q = 53 \rightarrow n = 157 ; n n is a prime number.

q = 59 n = 175 = 5 2 7 q = 59 \rightarrow n = 175 = 5^{2}*7 ; n n is not the product of two distinct prime numbers

q = 61 n = 181 q = 61 \rightarrow n = 181 ; n n is a prime number

q = 67 n = 199 q = 67 \rightarrow n = 199 ; n n is a prime number

And so on...

The first members of the set S S are: ( 33 , 85 , 93 , 141 , 201 , ) (33, 85, 93, 141, 201,\ldots) ; thus, the product sought is 33 85 93 141 201 = 7393174965 33*85*93*141*201 = 7393174965

Yeah a GIGANTIC but nice one !! , I'll try to rewrite a solution shorter than yours inspired from you .

A Former Brilliant Member - 6 years, 4 months ago

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!

Alexandre Miquilino - 6 years, 4 months ago

The numbers in question are :

n = 33 ( n = 3 × 11 ; n + 1 = 2 × 17 ; n + 2 = 5 × 7 ) n= 33 (n=3\times11 ;n+1=2\times17;n+2=5\times7)

n = 85 ( n = 5 × 17 ; n + 1 = 2 × 43 ; n + 2 = 3 × 29 ) n= 85 (n=5\times17 ;n+1=2\times43;n+2=3\times29)

n = 93 ( n = 3 × 31 ; n + 1 = 2 × 47 ; n + 2 = 5 × 19 ) n= 93 (n=3\times31 ;n+1=2\times47;n+2=5\times19)

n = 141 ( n = 3 × 47 ; n + 1 = 2 × 71 ; n + 2 = 11 × 13 ) n= 141 (n=3\times47 ;n+1=2\times71;n+2=11\times13)

n = 201 ( n = 3 × 67 ; n + 1 = 2.101 ; n + 2 = 7 × 29 ) n= 201 (n=3\times67 ;n+1=2.101;n+2=7\times29) .

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 = 121 n = 121 (which is of course 1 1 2 11^2 ) and thus got a smaller value for the answer.

But here's my corrected solution:

Observe that if n n is even then n + 2 n+2 is also even. Note that the only even prime is 2 2 .

Therefore n n and n + 2 n+2 each have a factor of 2 2 . Let the other factor of n n be p 2 p \neq 2 (since the prime factors are required to be distinct) for some prime p p and thus odd. So we have n = 2 p n = 2p and n + 2 = 2 p + 2 = 2 ( p + 1 ) n+2 = 2p+2 = 2(p+1) . Since p p is odd, p + 1 p+1 must be even. But this means p + 1 = 2 p+1 = 2 and thus we have a contradiction.

We conclude that n n must be odd, giving n + 1 n+1 to be the only even value of the three.

We have: n = 2 p 1 n = 2p -1 n + 1 = 2 p n+1 = 2p n + 2 = 2 p + 1 n+2 = 2p+1

Let S 5 S_5 be an empty set and P \Bbb{P} be the set of all prime numbers. Have p = p k p = p_k be k t h k^{th} element of P { 2 } \Bbb{P} \setminus\{2\}

Step 1 \textbf{Step 1} : Let k = 1 k = 1

Step 2 \textbf{Step 2} : If n n is prime go to Step 7. Otherwise, continue to Step 3

Step 3 \textbf{Step 3} : If n n has two distinct prime factors continue to Step 4. Otherwise go to Step 7.

Step 4 \textbf{Step 4} : If n + 2 n+2 is prime go to Step 7. Otherwise continue to Step 5

Step 5 \textbf{Step 5} : If n + 2 n+2 has two distinct prime factors append n n to the set S 5 S_5 and continue to Step 6. Otherwise go to Step 7

Step 6 \textbf{Step 6} : If S 5 = 5 |S_5| = 5 go to Step 8. Otherwise go to Step 7

Step 7 \textbf{Step 7} : Add 1 1 to the value of k k and go to Step 2

Step 8 \textbf{Step 8} : Multiply together all elements of S 5 S_5

Raphael Nasif - 6 years, 4 months ago

Log in to reply

Nice work Raph, it's clearer to me now that you've explained it STEP wise !!

A Former Brilliant Member - 6 years, 4 months ago

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)

Kartik Sharma - 6 years, 3 months ago

Log in to reply

@Kartik Sharma

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 :)

A Former Brilliant Member - 6 years, 3 months ago

@Kartik Sharma k Sharma, I posted one programming solution, is yours different?

Aditya Raut - 6 years, 3 months ago

Azhaghu Roopesh M people do methods, for this kind of questions, I do programs :P

img img

Aditya Raut - 6 years, 3 months ago

Log in to reply

Yeah quite a bit same as my approach!

Kartik Sharma - 6 years, 3 months ago

Coincidentally, I also called them 'Good'

Pranjal Jain - 6 years ago

What an idiot I am I computed the sum instead of the product .-.

Kunal Verma - 6 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...