Is 1 2 3 4 5 5 5 4 3 2 1 prime?
Hint: You may use the fact that 1 1 1 1 1 1 × 1 1 1 1 1 1 = 1 2 3 4 5 6 5 4 3 2 1 . This is similar to, but not identical to the above number, due to the middle 6 .
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.
Nice solution! I answered "No" because if the number were prime, the solution would have been ugly. :P
Log in to reply
Haha nice antisolution. To be honest, I also did the same thing. I also thought "No way this problem is good if the number ends up being a prime"
That's a pretty amazing pattern! I wouldn't have known how to factorize this (other than using a calculator).
Another approach:
1 2 3 4 5 6 5 4 3 2 1 = = = 1 1 1 , 1 1 1 2 ( 1 0 0 , 0 0 0 + 1 1 , 1 1 1 ) ( 1 0 0 , 0 0 0 + 1 1 , 1 1 1 ) 1 0 0 , 0 0 0 2 + 2 ⋅ 1 1 , 1 1 1 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 2 .
So we have:
1 2 3 4 5 5 5 4 3 2 1 = = = = ( 1 0 0 , 0 0 0 2 + 2 ⋅ 1 1 , 1 1 1 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 2 ) − 1 0 0 , 0 0 0 1 0 0 , 0 0 0 ( 1 0 0 , 0 0 0 − 1 ) + 2 ⋅ 1 1 , 1 1 1 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 2 1 0 0 , 0 0 0 ⋅ 9 9 , 9 9 9 + 2 ⋅ 1 1 , 1 1 1 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 2 1 0 0 , 0 0 0 ⋅ 1 1 , 1 1 1 ⋅ 9 + 2 ⋅ 1 1 , 1 1 1 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 2
and thus
1 2 3 4 5 5 5 4 3 2 1 = 1 1 , 1 1 1 ( 1 0 0 , 0 0 0 ⋅ 9 + 2 ⋅ 1 0 0 , 0 0 0 + 1 1 , 1 1 1 ) .
Love this. I tried to do something like this but didn't succeed.
I think there's a typo in the second equation: should it be 1 1 1 , 1 1 1 2 ?
12345554321 is a prime number . Can you check that again !!
Log in to reply
12345554321 = 11,111 * 1,111,111, so it is composite. Therefore, it is not prime.
Let
A
=
1
0
0
0
0
0
. Notice that
(
1
0
A
−
1
)
/
9
=
1
1
1
1
1
1
. Thus, we have:
1
2
3
4
5
5
5
4
3
2
1
=
1
1
1
1
1
1
2
−
A
=
(
1
0
A
−
1
)
2
/
8
1
−
A
=
1
/
8
1
∗
(
1
0
0
A
2
−
1
0
1
A
+
1
)
=
1
/
8
1
∗
(
A
−
1
)
(
1
0
0
A
−
1
)
so, that is not prime.
That's a nice way to factorize the number 12345554321. I think it would be clearer if you substituted the value of A back in the expression at the end and simplify it. This will make it clear that 81 divides the numerator, and the numerator is still composite after it has been divided by 81.
Wow, nice factorization! Let A = 1 0 0 0 0 0 makes this so much simpler :)
It's as simple as knowing 111111 is a factor of 12345554321 means it's not prime.
Log in to reply
Hm, but 111111 is not a factor of 12345554321. Let me make that clearer in the question.
Log in to reply
OH! I can see the difference now. Aha! I thought it seemed frighteningly simple aha!
Love this. I tried to do something like this but didn't succeed.
If it is the result of a multiplication, it is not prime.
Log in to reply
Yes. So we have to find the multiplication that works.
Note that the multiplication given in the question is for a different value.
Honestly all I did was add up the digits ( 1 + 2 + 3 + 4 + 5 + 6 + 5 + 4 + 3 + 2 + 1), which was (3 + 3 + 9 + 6 + 9 + 3 + 3) . When you add them together, you get 36, which is a multiple of 3. Therefore, it is divisible by 3.
(I'm pretty sure this method only works with multiples of 3 and 9)
(I know it's the really stupid way but I was lucky and it worked so I just went along with it)
Hmm, the question wants to check whether 1 2 3 4 5 5 5 4 3 2 1 is prime or not. The sum of its digits is 3 5 which tells us that it is not divisible by 3, but does not give us any more information on whether it is prime or composite.
It is a good idea to test divisibility by small numbers while testing if a number is prime. If we are lucky, we would find a divisor and we would be done. Proving a number to be prime is often more tricky.
All I did was: 1 3 2 4 5 5 5 4 3 2 1 = 1 1 1 1 1 1 × 1 1 1 1 1 1 − 1 0 0 0 0 0 = ( 1 1 1 1 1 + 1 0 0 0 0 0 ) × 1 1 1 1 1 1 − 1 0 0 0 0 0 = 1 1 1 1 1 × 1 1 1 1 1 1 + 1 0 0 0 0 0 × 1 1 1 1 1 1 − 1 0 0 0 0 0 = 1 1 1 1 1 × 1 1 1 1 1 1 + 1 0 0 0 0 0 × ( 1 1 1 1 1 1 − 1 ) = 1 1 1 1 1 × 1 1 1 1 1 1 + 1 0 0 0 0 0 × 1 1 1 1 1 0 = 1 1 1 1 1 × 1 1 1 1 1 1 + 1 0 0 0 0 0 0 × 1 1 1 1 1 = 1 1 1 1 1 × ( 1 1 1 1 1 1 + 1 0 0 0 0 0 0 ) = 1 1 1 1 1 × 1 1 1 1 1 1 1 . \ Thus, not a prime.
Log in to reply
Awesome! I like how you have distributed and combined terms to simplify the expression to a product of two numbers.
Honestly, I noticed that there were a possible 111111 numbers to check and figured that there is no way they expect us to check all of them to determine that it is prime - therefore it is not.
Log in to reply
Yup, it is always easier with composite numbers than with primes. Even if we just use brute force, for a composite number, we can stop the moment we find a divisor, but for primes, we have to go all the way up to n .
1 2 3 4 5 6 7 8 9 10 11 |
|
Could you explain more on what your program is doing?
i just added all digits together 1+2+3+4+5+5+5+4+3+2+1=35. it has a 5 in the end so can't be prime.
This is not how divisibility test of 5 works. Consider 23. We get 2 + 3 = 5, but 23 is a prime number.
The sum of the integers is divisible by three so the number itself is divine by three
The sum of the digits are 35, so this number is not a multiple of 3.
If we just modulo by 100, we are left with 21. Is 21 odd? the answers should be no.
Hm? Can you explain your idea further?
21 is indeed odd, but why does it show that the number is prime, or not prime?
Problem Loading...
Note Loading...
Set Loading...
I created this problem by thinking of why 1 1 1 1 1 1 × 1 1 1 1 1 1 = 1 2 3 4 5 6 5 4 3 2 1 . If we wrote out the multiplication, we would immediately see that
× 1 1 1 1 2 1 1 1 3 1 1 1 1 4 1 1 1 1 1 5 1 1 1 1 1 1 1 1 6 1 1 1 1 1 1 1 5 1 1 1 1 1 1 4 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1
That led me to think about how we can get similar patterns by chaging the number of 1's. For example,
× 1 1 1 1 2 1 1 1 3 1 1 1 1 4 1 1 1 1 1 1 5 1 1 1 1 1 1 5 1 1 1 1 1 1 1 5 1 1 1 1 1 1 4 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1
Hence, this number is not prime. We have 1 2 3 4 5 5 5 4 3 2 1 = 1 1 1 1 1 × 1 1 1 1 1 1 1 = 4 1 × 2 3 9 × 2 7 1 × 4 6 4 9 .