As other comments have shown, the modulus work wasn’t necessary. It’s a way to do it which works, but there are definitely easier methods which don’t require any mods.
I was was able to solve this one in 60 seconds in my head quite simply. If T is the digits of N added together then: 222*T-2022=N So trying values of T… 222*10-2022=198 ( invalid) 222*11-2022=420 (invalid) 222*12-2022=642 ( valid) Because 12=6+4+2
After you figured out 2022+abc=(a+b+c)*222, its easy to estimate a+b+c sum should be between 10 and 13. Thats just 4 variations you should substitute and find if abc number have same sum of digits.
This is what I did! From a practical standpoint, reducing the number of things to check is probably going to win out over checking the mod 3 path for most people.
Solution: Let this 3-digit number be n=abc. It is easy to prove that the sum of all six possible numbers obtained by permuting the digits in a 3-digit number is 222(a+b+c). Taking this fact into account in the solution, we get that k=a+b+c 222k-n=2022 n=6(37k-337) For n to be 3-digit, it is clear that the condition 9
Honestly no need to bring in the mod 3 stuff. You know it's a multiple of 222 that's larger than 2022 but smaller than 2022+987=3009. Just check each multiple within that range until the sum of the digits of 222x-2022 equals x x=10 is the first x larger than 2022, and 2220-2022=198, whose digits sum to 18. Gonna shortcut this further by just adding 222 to this number to get the next multiplier Add 222 to get x=11. 420 sums to 6. Add 222 again to get x=12. 642 sums to 12 Add 222 again to get x=13. 864 sums to 18 Adding 222 again gets a 4 digit number, so it's out of the question. Only at x=12 does the sum equal 12, so 642 is the answer.
@@verkuilb"The digits on N can be swapped to get five new numbers" This means they must be different digits. Any repeats would make it impossible to have five other new numbers.
@@alexharkler No it doesn’t. The digits can be swapped to get five NEW numbers-but it doesn’t say they are necessarily DIFFERENT numbers. Besides, if what you say were true, then N wouldn’t “larger than 2022”, but “larger than 2022 + 012 = 2034”.
I started the same way as you. But I avoided the modulo by creating a fast algorithm: 1) we know: 222*(a+b+c)=2022+abc for the reasons you gave 2) we know: a+b+c must be at least 10, since 2022/222=9.108... 3) we know: a+b+c must be smaller than 14, since (2022+1000)/222=13.61... 4) we do: calculate 222*x-2022=abc with x values from 10 to 13 5) we test: add the digits of abc. If they don't add up to x, increase x by 1 and back to 4. If they add up to x, you have found a solution. 6) we conclude: The only solution was: x=12 => abc=642
Also, notice that 222 and 2022 are multples of 3. So abc must be a multiple of 3. Hence (a+b+c) must be a multiple of 3 by division rule. Thus after step (3) we can directly conclude that (a+b+c) = 12
Divide 2022 by 5 to get the average leading number of about 4. To maintain this average, the other two digits could be either (3,5), (2,6), or (1,7). In all cases, the sum of all 6 permutations will be 2664. But we want the number whose removal will yield 2022. This number is 2664 - 2022 = 642 which is our desired answer.
Five different numbers... six permutations. I call that 6 different numbers, but the question expects you to exclude the original number N from the permutations leaving 5. Perhaps the original question in French was less ambiguous...
Also, one simple observation which I think you missed (unless I overheard it) is that if the digits can be swapped to get FIVE NEW numbers, then all the digits must be different. If you had two of the same (like 3 6 6), you would only be able to create fewer than 5 new numbers.
@@verkuilb If two of the digits are the same, then one of the supposedly "new" numbers will be identical to the original number N -- and hence it will not be a "new" number. So no, if the three digits are not different, then it's not possible to create five new numbers.
Your solution is way more complicated. I used this method. It is simpler. Write other 5 numbers in 5 rows downward as we did addition in our childhood. acb bac bca cba cab + _______ 2022 -------- From this we can do a little bit assume that addition of 3rd column should be 22. We write 2 and save 2 (or 20) for the 2nd colunm. Addition of 2nd column should be 20. Then 20+saved 2 = 22. We then again save 2 (or 200). Addition of 1st column should be 18. Then 18+ saved 2 = 20 We can develop 3 simultaneous equations as below. 2a + 2b + c = 22 2a + b + 2c = 20 a + 2b + 2c = 18 Solve this and you easily get the answer a = 6, b = 4, c = 2
I did it wayyyyyyyy simpler. 1) If adding the 5 new numbers together gives 2022, then 2a + 2b + c = ?2 ... can be 2, 12, 22, doesn't matter, we know we're dealing with even numbers and z has to be even. 2) Average of the 5 numbers has to be 404.4 (=2022/5). So the first digits (a, 2b, 2c) will average less than 4 (to account for the other two digits) but not far below. So either b or c will likely be 4, with the other not much less than 4 and a must be not much greater than 4. 3) And since we're dealing with even numbers, the most logical first guess would either be 642 or 624. Making 4 of the 5 numbers 426, 462, 264, and 246. Subtract them all from 2022 and the remaining number is 624...making the final permutation the answer of 642.
Another way to solve it is to use a system of equations and considering the carryover of the digits sum. Calling N digits n1,n2,n3 Starting from 2022+(100*n1+10*n2+n3)=222*(n1+n2+n3) Therefore 122*n1+212*n2+221*n3=2022 Then splitting into the sum of digits, we can consider A) 1*n1+2*n2+2*n3+c2=20 B) 2*n1+1*n2+2*n3+c1=2+10*c2 C) 2*n1+2*n2+1*n3=2+10*c1 Where c1 and c2 are the carryovers for the sums Then summing up A+B+C we get 5*(n1+n2+n3)=24+9*(c1+c2) For the right hand to be multiple of 5 then c1+c2=4 (so there are 3 possibilities of c1,c2=(1,3),(2,2) or (3,1) ) Thus n1+n2+n3=12 or D) 2*n1+2*n2+2*n3=24 Then doing D-C n3=22-10*c1 So the only way 1
It's been long since I last had to pause the explanation and rewind it. What a complex solution for a problem that didn't look that hard to get to the general equation
The sum of the six digits would be a multiple of 222 due to the summing of the 6 iterations of the digits with each digit twice in the hundreds, tens, ans ones positions. Aiming for 2220 gives us a difference of 198, but these digits' sum of the remaining 5 iterations is too high. Adding 222 to 198 ends in zero, which isn't usable in this problem, but adding 444 works and solves.
I accidentally did it mentally (after much fiddling and number figuring) for 2202 and then realized that the problem was for 2022, but then noticed hey I have to swap numbers such that the hundreds goes down by 2 while the tens go up by 2 so I knew I had the right 3 digits but picked the wrong number to “exclude” from the sum which was 462. Easiest way to flip it around correctly is to swap it with 642
(2022+N)/222=(a+b+c). 2022+N has to be divisible by 222, which means that N=198+222k. For this N, the formula gives result (a+b+c)=10+k. You get 4 options (198,420,624,864) and “digit sums” according to the formula (10,11,12,13). Out of those, 624 is the only option.
All six numbers sum to 222(a+b+c), and five of them sum to 2022. So the search is on for the smallest integer n ≥ 10 where 222n-2022 is a 3-digit number whose digits sum to n. And the search ends at n=12 because 222•12-2022=642 and 6+4+2=12. Therefore a=6, b=4, c=2; without the long tangent on congruence modulo 3.
MindYourDecisions gets a B- for this "solve" which completely ignores the logical deduction that none of the digits can be the same, and opts for a convoluted MOD(3) based approach that was completely unnecessary.
We know its gonna be approximately 400x5 so start with the 4. For each digit column we include one digit once and the other two twice. Cannot contain 2 odd numbers and make 22 so we skip 435 and go to 426. 22 is 66442 summed so final digit is 2. Excluding 4 gives 20, excluding 6 gives 18. 1800+200+22. Therefore 642.
Hello Presh, I used Excel to solve this mystery number, with the following method; 1: 3 cells from left to right to hold each digit of the number - A1 to C1 2: 6 cells in column D to hold the calculated results of the numbers in A1 to C1 - =SUM(100*A1)+(10*B1)+C1, etc 3: 6 cells in column E to hold the sum of Column D, minus the cell to the right - =SUM($D$1:$D$6)-D1, etc 4: An OR function in F1 to find 2022 - =OR(E1=2022,E2=2022,E3=2022,E4=2022,E5=2022,E6=2022) 5: Start typing numbers in A1 to C1, until F1 says TRUE, then arrange them until the correct answer is in cell E1 6: Answer is 642 Thanks for a great video. I'm enjoying the content on your channel, and regularly give the problems a try. Keep up the good work Andrew
def find_number(): for a in range(1, 10): for b in range(0, 10): for c in range(0, 10): N = 100 * a + 10 * b + c # Generate the five permutations perm1 = 100 * a + 10 * c + b perm2 = 100 * b + 10 * a + c perm3 = 100 * b + 10 * c + a perm4 = 100 * c + 10 * a + b perm5 = 100 * c + 10 * b + a # Sum of permutations total = perm1 + perm2 + perm3 + perm4 + perm5 if total == 2022: return N return None result = find_number() print("The value of N is:", result)
The mod 3 is massively overcomplicated. Much simpler sulution: once you realize that the 222 (a+b+c) relationship, just start by elimination. If a+b+c = 10, the sum of all 6 numbers is 10 x 222 = 2220. The mystery number would need to be 2220-2022 = 198. But its digit don't sum up to 10. So not this one. If a+b+c = 11, the sum of all 6 numbers is 11 x 222 = 2442. The mystery number would need to be 2442-2022 = 420. But its digit don't sum up to 11. So not this one. If a+b+c = 12, the sum of all 6 numbers is 12 x 222 = 2664. The mystery number would need to be 2664-2022 = 642. Its digit sum up to 12! BINGO! Go further to find if this is the only one...
Solve this in a min through basic logic - was clear that the average number needed to be around 4, and that you could have hundreds, tens, and ones sums of 18, 20, and 22; with this in mind, you make sure that the difference between the transposed ones and hundreds spot was 4 and that the omitted tens was 4 as well, leaving only 6-4-2.
Fairly easy to guess. Instant observation is that the sum of 2022+N is going to be divisible by 222, with the first candidate being 2220 which would make N equal to 198. This can be discarded as (9+8)*200 is already much larger than the target. Next value for N will be 420 which can be discarded as well because (2+0)*200 is much too small. Which gets you to 642 as the next in line and gives the correct result. In hindsight I found that it was in fact even simpler and wouldn't even require validating the sum of the permutations as all you need to check is whether the sum of the digits matches the factor of 222 for the target number 2022+N
The methods allowed in the competition presumably require the problem to be solved with pencil and paper (if not in head). However, a direct attack led me to derive the coefficients of a, b and c in the equation 2022=ax+by+cz as 122, 212 and 221 respectively, based on the consideration that a cannot appear twice in the 100s column etc. The solution comes from the reflection that there must be some combination of choices of b and c such that the difference between 212b and 221c is divisible by 122 (and similarly for the other combinations). As luck would have it, this method quickly yielded 6 as the value of a etc. But it couldn't be done this way in competition conditions, I imagine. On the other hand, I don't feel too bad about it, as the method using modular arithmetic also required trial and error and quite a lot of calculation.
Let the 3 digit number be 100a + 10b + c where a,b,c are the digits, then: (100*a+10*c+b) + (100*b+10*a+c) + (100*b+10*c+a) + (100*c+10*a+b) + (100*c+10*b+a) = 2022 Which simplifies to 122a + 212b + 221c = 2022 where integer solutions for a,b,c are 6, 4, and 2.
That needs a little bit of guessing, right? I did the same. The only thing I added is that if you divide 2022 by 5 to get the average of those 5 numbers, you get 2022/5=~404, so the middle digit is most likely a '4'.
@siavashakrami3444 It might take a lot of guessing to do the last step yes, but I was showing a method that simply proves it's 6, 4, 2 and nothing elelse, not necessarily the easiest or fastest way but I think the easiest to understand. I don't think dividing 2022 by 5 means the middle digit is most likely to be a 4 though.
MOD is not in any school maths. Solution: for N=abc and to get ∑(acb+bac+bca+cab+cba)> 2000, and last digit 2, either 2a+2b+c=12 OR 22, BUT from 2022, first column 2 means carry must be 8, impossible. Thus 2a+2b+c=22, 2a+b+2c=20, a+2b+2c=18. By subtraction, a-b=2, b-c=2, a-c=4, THUS all even, all different, none zero. Solution can only be EITHER 864 OR 642. By substitution into 2a+2b+c=22, answer is 642
Interestingly, the sum of the 5 new numbers produces 900 unique solutions, one for every original number. The sum of the 6 numbers does produce only 27 solutions as alluded to in the analysis.
Wild, I took a completely different approach. N = 3 digit number. So each digit must be between 0 and 9. They can be rearranged to form 5 new numbers. So none of the digits repeat. Of these 5 numbers we we know one of the reverse pair, the N. Isnt in the sum. So for the last digit, ABC. C must only occur once. We know 2 is the sum of single digit number. Only two numbers can give you 2 for C. 2 or 6. We also know that the other 4 numbers, 2a+2b must be equal to 20 or a+b =10. So we have 2, 6, and X. We also know the middle number or B, only appears one in the middle summation. 22 is already creates by 2a+2b+c, that means 2a+2c+1b must be equal to 0. Using 6 and 2 as our possible c we're left with 4 as our B thus locking in 2 for c and 6 for A. 642.
@gavindeane3670 yes, since N is not specific no., it's just three digit no, which All the other permutations satisfies just as 642. And all other five number have the same permutations. It just shuffle of same three number.
@@GsBabu-sk6iv Only one of the six permutations will satisfy the equation 222*(a+b+c) = 2022 + N (a+b+c) is the same for each of the six permutations (namely (a+b+c) = 6+4+2 = 12 ), but N will be different for each permutation; so only one N will satisfy.
@@yurenchu yes, but the question is not asking for that specific N, it clearly wants numbers whose digits are permutations satisfying the equation. The equation which has to be satisfied is specific, the N is not Asked specifically, hence the solution is the 'Set of permutations of N'. N is just a notation of understanding.
@@GsBabu-sk6ivThe question is asking for that specific N. It literally says "What is the value of N?" The five numbers that are NOT N sum to 2022. You do realise there are six 3-digit numbers here, right? N is one of them. The other five are the five other permutations of the digits of N.
You can also tell that abc is even, because the sum of all six permutations is a multiple of 222, which is even, and the sum of all except abc is 2022, which is also even. So abc is a multiple of 6.
I wrote a quick program to search through the numbers from 000 to 999. It found 642. It took a few minute to write the program and < 1second for the program to find the answer.
Digit sum = (2022 + N)/222 = 9 + (24+N)/222. It must be an integer, of course. And N is positive and less than 1000. So we check N = 198, 420, 642, 864 looking for digit sums 10 through 13 respectively. And 642 is the only one that works (the expected digit sum of 12 indeed matches 6+4+2).
222(a+b+c)=2022+abc We can easily know 9 < a+b+c < 14, because 222x9 = 1998 < 2022 , 222x14 = 3108 > 2022+999. So we only need to check for a value of a+b+c=10, 11, 12, 13.
The problem for me is the definition of "swapping" digits. To me this is different from simply arainging the digits in a different order, but instead would imply exchanging the positions of two of the digits. So if N is abc, then the available swapped values are bac (a & b swapped), cba (a & c swapped), and acb (b & c swapped). Any other araingements require moving a digit from the front to the back (abc -> bca) or back to the front (abc -> cab) operation instead.
It's very normal phrasing in English, albeit colloquial, to say that you can swap the digits of abc around to get, for example, cab, but I noticed the same thing as you. It felt like more informal, imprecise wording than might be expectef in a technical question like this. But given that "swapping" creates five new numbers, it was obvious what was meant.
@@edwardblair4096 Start from N = [abc] ... swap a and b ... --> [bac] = M1 ... swap b and c ... --> [cab] = M2 ... swap a and b ... --> [cba] = M3 ... swap c and b ... --> [bca] = M4 ... swap b and a ... --> [acb] = M5 There you go , five new numbers: M1, M2, M3, M4 and M5 !
Oops, I forgot about 0. But if 0 were one of the digits then two of the numbers would have only two digits. That wouldn't fit in the problem as stated, so my observation is valid.
Going from the thumbnail I grabbed a piece of paper and came up with N = 642 But once I came up with the coefficients 122a + 212y + 221z = 2022, I bruteforced the possible values of x, y, z (up to 1000 options) with a script to get the answer.
I did the same method, but the first set of values I tried was x=3 y=2 and z=1, which game me sum of 1011. Since that's half of what I needed, I just multiplied it by 2 and got the answer.
I took your formula, solved for the formula for z, and then bruteforced the 9x9 grid of possibilities with a spreadsheet. Only 1 value had an integer result. (I eliminated 0 as a possible digit value, as I didn't think that 0ab qualified as a three digit number)
Hard one. I don't know where you got the modulus trick, good lesson. But it'd be cleaner if you enforce a != b != c: or you couldn't have 6 combinations. So max would be 987 in the end parts, etc.
Yup. The 3 digits can not be equal is one hint and the sum of 5 permutations is even (>2k) is another. These 2 can be put together to get the combination right.
Paused. If we express the digits of N as "htu" for Hundreds, Tens, and Units, (not using O for ones as it looks like a zero), then we would get these five permutations: hut uht uth thu tuh Because we exclude the number N itself, the htu permutation isn't included. But across all permutations, each digit would occupy each column twice. If you exclude N (htu) then the hundreds digit (h) would occupy the hundreds column only once, but the tens column twice, and the ones column twice. Likewise the tens digit (t) would occupy the tens column only once, but the hundreds and ones columns twice. The units digit (u) would occupy the ones column only once, but the hundreds and tens columns twice. Since 2022 is a sum of the 5 permutations and we know how many times each digit is allowed to occupy each position, we can write a formula for the whole expression like so: (100h + 20h +2h) + (200t + 10t + 2t) + (200u + 20u + u) = 2022 -> combine like terms: 122h + 212t + 221u = 2022 Now I note that the coefficient for h and t are both even, which means that if you deduct 221u from 2022, you can automatically exclude certain values of u because they would yield an odd number, and no even numbers will add up to an odd number. So for example if the units digit was 1, then 2022 - 221x1 = 1801, and there is no way to split 1801 into a stack of numbers that are all divisible by 2. So if we try each possible value for U, we will find that we only get an even number when 221u is deducted from 2022 when U itself is even... 221 ends in 1 so 221 times any odd digit will also end in that odd digit. So U can only be 0,2,4,6 or 8. We can refine this a little further because 221x8 is 1768, and if you deduct that from 2022 you get 254 which is smaller than 122+212, and not divisible by either 122 or 212. At this point I just brute-forced the problem, because with U being 0,2,4, or 6, the number of possibilities remaining gets reasonable. With a given U, if I pick a value for T and deduct 212T from (2022-221U) I should get a value which is a multiple of 122 which seems like it would be pretty easy to spot. If U is 0, no value of T works, but if U is 2, and T is 4 you are left with 732 which is 6x122 which means H should be 6. 122x6 + 212x4 + 221x2 = 2022, so N is 642.
Simpler to avoid mod function, 221a + 212b + 122c = 2022 and a must be even 2,4,6 or 8. For a=2, 106b+61c=790. Try values of b, example for b=6, 61c=144 won't work. Try b=4, c=6. Solved.
Right off, I have a confusion or a contradiction. You begin by counting permutations of abc. But the question asked was about swaps. The swap of a with b and the swap of b with a are the same. The swap of b with c and the swap of c with b are the same.The swap of a with c and the swap of c with a are the same. That's all the possible swaps. The only way you can get 5 swaps is by getting from abc to other permutations using multiple swaps.
It's normal in English to say you can swap the digits abc around to get acb and bac and bca and cab and cba, but it is informal, colloquial, imprecise language. Once you read that we're creating five new numbers it's clear what he means by "swap", but in a technical question like this you'd expect more precise language.
I had a different approach. Since 2022 ends in even number and there should be five last digits that when added together must be the result an even that means that all of the digits of N are even.since at average the sum is 404,4 ( 2022 /5 = 404,4 ) then that means that the digits should be 2, 4, 6 because if multiplied by 100 they fall around 404,4. So you add the 5 most logical numbers that are created by those 3 digits and you find out the result is 2022
Figured there were 221 As, 212 Bs and 122 Cs. Guessed at a couple of A and B options until I found a C that added up properly. Faster than Presh, but he was making a video, so he'd have beaten me to death, I'm sure.
Gestimations lead me to conclusion that on avarage this should be 404,4 I guested that it should be around 400, 600, 600, 200 and 200 so on average will go down to 400, but forgot about extra digits :) 222 helped to find last piece of the puzzle
I guess my solution method was suboptimal, but I found it a lot easier than all the mod 3 stuff and keeping the disallowed permutation in the solution.
Here's how I solved it: N + 2022 = 222(a + b + c) Since 2022 is 6 more than a multiple of 9, it follows that N is 3 more than a multiple of 9. Since N is 3 more than a multiple of 9, so is the sum of its digits; that is, a + b + c = 9n + 3. Proceeding from there: N + 2022 = 222(9n + 3) N + 2022 = 1998n + 666 N + 1356 = 1998n n has to be 1(because n = 2 requires N to be a four-digit number), so N = 1998 - 1356 = 642.
The question in the title of your video is, “Can you solve for the mystery number?” Therefore, the answer is NOT 642-as the question is in binary “Yes/No” form. In my case, the answer is “Yes”-but anyone who was unable to determine 642 on their own would be giving a CORRECT answer if they replied “No”.
well that's the answer to the question of the video's title, not the question inside the video to which he is answering but yea you can indeed solve the title's question with a "yes/no"
The title specifies if you Can, not if you Did. So, a large chunk of people who answered No may be wrong simply because they didn't try all the possibilities.
I haven’t yet watched the video… took me a little while to work out how best to approach it, but here’s how I finally solved it… Rewrite N as 100a+10b+c. The sum of all six numbers representing all six arrangements of the digits is 222(a+b+c). We want the sum of just 5 numbers (excluding 100a+10b+c), so 222(a+b+c) = 2022+100a+10b+c = 2022+N. Therefore 2022+N is divisible by 222. Therefore (a+b+c)=[10, 11, 12, or 13]. I tested for each possibility, noting that 222*[given possibility]-2022 must result in a 3 digit number (thus excluding possibilities greater than 13) whose digits sum to [given possibility]. The only possibility that passed this test was 12. 222*12-2022=642. Therefore N=642.
A bit old, but H Davenport the higher arithmetic is very readable and introduces modular arithmetic and some pretty deep results. I read it at 14 and it helped get me a degree! Davenport was the supervisor of John Horton Conway (RIP) who invented the game of life cellular stuff. HTH.
This is wrong, right? I mean, it's correct but that is not the answer. In 0:16 Presh says "If we add there FIVE number we get 2022". Only the 5 new numbers, not ABC. We get 122*a + 212*b + 221*c. Now what?
That's a lot of maths, I just used excel last digits of the 5 needed to add to 22, middle digits to 20 + carried 2, and the first digits had to add to 18 + carried 2. wasn't hard to tweak the numbers. Got the answer in 3 mins. Who needs maths when you have excel.
I got this but totally more roundabout. First I looked at 2a+2b+c = ?2. So it's either 12 or 22 and c is even. With c being even, 12 requires 1 3 2 or 3 2 1 which doesn't work for the rest of the problem. Then realize there must be carrying so I split the columns: the ones column adds to 22, carrying 2. The tens column adds to 10 or 20, with a carried 2. 10 is impossible with 2x+2y+z, so is had to be 20. also b must be even. The hundreds column adds to 18, (a is also even) so the columns are 18, 20, 22 . The lowest 2x+2y+z using 8 is 2*8+2*2+4= 24, so 8 is a no-go. The remaining even numbers are 2 4 and 6. each of the three columns is missing a number, the ones is missing the smallest one, and the hundrens missing the largest. so 642. Yeah.. really convoluted but it works
"Modulo N" just means "considering only the remainder of the division by N", for example 1234567 = 7 mod 10. The nice thing about modulo arithmetics is that many things mostly work out exactly as you might hope, in particular addition, multiplication, and powers all work just fine. For example if you want to compute 123 * 457 modulo 10, you can just compute the modulos of each number first (123 = 3 mod 10, and 457 = 7 mod 10), and then multiply them. Therefore: 123 * 457 mod 10 = 21 mod 10 = 1 mod 10 You can even compute huge powers modulo N very efficiently, even by hand. This is used heavily in cryptography. For example: 1234567^9876543 mod 10 = 7^9876543 mod 10 = 7 * 7 ^ 9876542 mod 10 = 7 * (7^2)^4938271 mod 10
So we have a number of 6 valid distinct numbers by permuting the digits. This means every digit is distinct and Nonzero. Each digit appears in every position 2 times so the sum of all the numbers should be 2*111*(a+b+c)-100a-10b-c=2022 122a+212b+221c=2022 Since 122, 212 and 2022 are even then c must be even so either 2,4,6,8 I c=2 => 122a+212b=1580 61a+106b=790 So a must be even too and different from c. a=4 => 106b=546 false a=6 => 106b=424 b=4 624 answer a=8 => 106b=302 false II c=4 122a+212b=2022-884=1138 61a+106b=569 so a is odd a=1 106b=508 F a=3 106b=386 F a=5. 106b=264 F a=7. 106b=142 F III c=6 122a+212b=2022-1326=696 61a+106b=348 a=2 106b=226 a=4 106b=104 c=8 122a+212b=2022-1768=254 not possible
I was once asked as to what the difference between an educated person and an intelligent person is. An educated person would tell you that 2+2=4. An intelligent person would tell you why that is.
"222 is clearly a multiple of 3..." Is that supposed to be clear? You make a lot of assumptions like that, Presh. Things that are clear/obvious to you may not be to someone else.
@@Doc_Fartens When M is an integer, then {sum of digits of M is divisible by 3} ⇔ {M is divisible by 3} So, 222 is divisible by 3 because 2+2+2 = 6 is divisible by 3 .
eazier with no mod 3: (a+b+c) =x 222x = 2022+ N for x = a+b+c = [10, 11, 12, 13] we have 2022 + N = [2220, 2442, 2664, 2886] and N = [198, 420, 642, 864], the third option is correct, i.e. a+b+c = 12 and N = 642
Pretty sure that Presh is now giving us inefficient answers to drive engagement in the comments. I guess you have to do what you have to do on YT. Just a shame really.
@@Konanzor if M is an integer, then it turns out (and it's easy to prove) that { sum of digits of M } ≡ M (mod 3) So if M is a multiple of 3 , then M ≡ 0 (mod 3), and hence also { sum of digits of M } ≡ 0 (mod 3) or in other words, the sum of digits of M is also divisible by 3 . Example: the sum of digits of 222 is 2+2+2 = 6 , which is divisible by 3 , and hence 222 is also divisible by 3 . A similar rule applies for divisibility by 9 .
I'm sick and it's late over here. But out of my hat: the Digits must be different from each other or you couldn't form new numbers. Also all 5 together give 2022, so without checking it i would say it's likely that the high digits 7, 8 and 9 aren't included because that would give to high of a sum.
What confused me was the word 'swapped'. Thinking you could change one of digits for any other digit.(0-9) Maybe it's in the translation from French to English? Maybe should have used the word 'rearranged'
The brute force method was more satisfying than all this mod stuff. I managed to get to 122a + 212b + 221c = 2022 and we know that all a,b,c are digits between 1 and 9 (both included). So there are 729 possibilities... (1,1,1), (1,1,2),....all the way to (9,9,9) So I used my computer. And only one possible solution is 642. I thought the video would be about some clever trick to shorten this pool of 729 options to something manually manageable. Instead, it was more complicated. So I am more satisfied with my way of solving it.
I shortened it to 4 options I could do without paper. Your 122a+212b+221c is actually simpler put as 222(a+b+c)-N N=222(a+b+c)-2022 Since N is limited to exactly 3 digits, 10≤(a+b+c)≤13. Only 4 options to test for N: 198, 420, 642, 864. Immediately we can see 6+4+2=12 is the only solution within the range giving N=642 as the only solution
nice!, i did from itertools import permutations def find_number(): for n in range(100, 1000): digits = str(n) perm = set(permutations(digits)) perm_numbers = [int(''.join(p)) for p in perm] if len(perm_numbers) == 6 and sum(perm_numbers) - n == 2022: return n result = find_number() print(f"The value of n is: {result}")
I think the solution in the video is over-complicated. If N is the number and D is the digit sum of N, then we have 222 × D = 2022 + N The maximum possible value of N is 987 so the max of 2022+N is 3009 Therefore 222×D must be between 2022 and 3009. That gives only four possible values for D: 10, 11, 12 and 13. It's easy to check those four options for D to see whether the digit sum of N is equal to D. Only D = 12 and N = 642 works.
Your solution is very nice but too complicated. There is a shorter solution. 1) write the sum as: acb bac bca cab cba + ------------ 2022 2)call right column LC, LC=a+2b+2c center CC, CC=2a+b+2c left RC, RC=2a+2b+c 3)note that since LC is even c has to be even (2,4,6, or 8) 4)RC couls be 12,22,32, or 42 5)CC-RC=c-b note that -7
Fun! But you started out by saying this was for 15-16 year olds. They would NOT be able to do this (I have studied math for 3 ys at the university and we never ever saw the "modulo-thing"). You should have deducted that there was a much easier way! :)
Welp as someone round that age group I didn't do it in any complex manner, I simply started with high numbers and low numbers and eventually finding a median (my closest was 543, I did try 642 iirc however I rearranged the numbers wrong hence not getting the right answer), if the product was high, I'd subtract a high order number (essentially excluding it and making it seem like the original number) if the product was low, I'd subtract a low order number and do the same thing, the worst part was that I tried the correct number yet in the wrong way
Adding up the 5 possibilities, I got the equation 122a + 212b + 221c = 2022. Since 2022 is an even number then "c" must also be an even number in order for the the left side to add up to even. Therefore, c must be the number 2, 4, 6 or 8. Using trial and error, I start with c = 2 which means "b" must be less than 8. Plugging in numbers less than 8 and solving for an integer value for a, it worked out that b = 4 and a = 6. So, I got very lucky with the first round simply using c = 2 😉
I solved it next way. Five numbers gives us 2022. So the medium of this numbers is around 400. So i supposed we are searching for a number abc with (a+c)/2=4 and b=4. So firstly i checked 345 and it's variations (354, 453, 435, 534, 543), found the sum of all 6 numbers and try to decrease the sum by one of them to get 2022. I got no luck. So then i checked 246 and (246+264+426+462+624+642)-642 gives me 2022. That's it! (I know this is not correct mathematical way to solve but still i found the answer very quickly)
I was getting there by guess and by golly. I knew a+2b+2c was somewhere around 18ish and c was definitely even. I had tested 552, 454, and 452. So I was closing in. But doubt I could have done it with anything but brute force. I should have known 454 was not a contender though.
I got lost when the mod 3 stuff came in
@@rogerkearns8094I think they mean WHY they brought it in VS what it is.
As other comments have shown, the modulus work wasn’t necessary. It’s a way to do it which works, but there are definitely easier methods which don’t require any mods.
it's basicaly how much exceeds in a division
for example, 8 (mod 3) = 2 , because 3*2 = 6 and the reminder is 2
hope that helps :D
Same, never heard of that before today
Fr
I was was able to solve this one in 60 seconds in my head quite simply.
If T is the digits of N added together then:
222*T-2022=N
So trying values of T…
222*10-2022=198 ( invalid)
222*11-2022=420 (invalid)
222*12-2022=642 ( valid)
Because 12=6+4+2
Why 222 tho
@@Oxygenationatom if you were to consider all the permutations of 3 items, then each column would have 2 of each item
Very interesting and simple solution indeed! Congrats!
This is exactly what I did. Way simpler.
Um ... which is basically what Presh did here, just minus all his painstaking explanatory steps in between ...
After you figured out 2022+abc=(a+b+c)*222, its easy to estimate a+b+c sum should be between 10 and 13.
Thats just 4 variations you should substitute and find if abc number have same sum of digits.
This is what I did! From a practical standpoint, reducing the number of things to check is probably going to win out over checking the mod 3 path for most people.
This what I did.
Solution:
Let this 3-digit number be n=abc.
It is easy to prove that the sum of all six possible numbers obtained by permuting the digits in a 3-digit number is 222(a+b+c).
Taking this fact into account in the solution, we get that
k=a+b+c
222k-n=2022
n=6(37k-337)
For n to be 3-digit, it is clear that the condition 9
Same for me ... very easy problem 😂
Honestly no need to bring in the mod 3 stuff. You know it's a multiple of 222 that's larger than 2022 but smaller than 2022+987=3009. Just check each multiple within that range until the sum of the digits of 222x-2022 equals x
x=10 is the first x larger than 2022, and 2220-2022=198, whose digits sum to 18.
Gonna shortcut this further by just adding 222 to this number to get the next multiplier
Add 222 to get x=11. 420 sums to 6.
Add 222 again to get x=12. 642 sums to 12
Add 222 again to get x=13. 864 sums to 18
Adding 222 again gets a 4 digit number, so it's out of the question.
Only at x=12 does the sum equal 12, so 642 is the answer.
Technically, there isn’t anything saying the digits must be different, so the largest number is 999, not 987. But otherwise, you’re correct!!
I just did by hit and trial
@@verkuilb"The digits on N can be swapped to get five new numbers"
This means they must be different digits. Any repeats would make it impossible to have five other new numbers.
I did it exactly the same as you outline. So much quicker our way.
@@alexharkler No it doesn’t. The digits can be swapped to get five NEW numbers-but it doesn’t say they are necessarily DIFFERENT numbers.
Besides, if what you say were true, then N wouldn’t “larger than 2022”, but “larger than 2022 + 012 = 2034”.
I started the same way as you. But I avoided the modulo by creating a fast algorithm:
1) we know: 222*(a+b+c)=2022+abc for the reasons you gave
2) we know: a+b+c must be at least 10, since 2022/222=9.108...
3) we know: a+b+c must be smaller than 14, since (2022+1000)/222=13.61...
4) we do: calculate 222*x-2022=abc with x values from 10 to 13
5) we test: add the digits of abc. If they don't add up to x, increase x by 1 and back to 4. If they add up to x, you have found a solution.
6) we conclude: The only solution was: x=12 => abc=642
Also, notice that 222 and 2022 are multples of 3. So abc must be a multiple of 3. Hence (a+b+c) must be a multiple of 3 by division rule. Thus after step (3) we can directly conclude that (a+b+c) = 12
Divide 2022 by 5 to get the average leading number of about 4. To maintain this average, the other two digits could be either (3,5), (2,6), or (1,7). In all cases, the sum of all 6 permutations will be 2664. But we want the number whose removal will yield 2022. This number is 2664 - 2022 = 642 which is our desired answer.
Five different numbers... six permutations. I call that 6 different numbers, but the question expects you to exclude the original number N from the permutations leaving 5.
Perhaps the original question in French was less ambiguous...
It says 5 new numbers, not different.
@@sirjohnnygbut the sum of the new 5 numbers is 2022, not sum of the 6
@@smallhabibidecisions9649which is what the question clearly stated and what was solved for here. The 5 new numbers sum to 2022.
It's not ambiguous. The five new numbers sum to 2022.
You correctly and unambiguously described that too.
Also, one simple observation which I think you missed (unless I overheard it) is that if the digits can be swapped to get FIVE NEW numbers, then all the digits must be different. If you had two of the same (like 3 6 6), you would only be able to create fewer than 5 new numbers.
The notation abc already implies that.
@@EquuleusPictor No it does not.
I disagree. “New” does not necessarily mean “uniquely different”. You can get multiple new things which are identical to each other.
@@verkuilb If two of the digits are the same, then one of the supposedly "new" numbers will be identical to the original number N -- and hence it will not be a "new" number. So no, if the three digits are not different, then it's not possible to create five new numbers.
@@verkuilb"New" very obviously means uniquely different in this context.
Your solution is way more complicated.
I used this method. It is simpler. Write other 5 numbers in 5 rows downward as we did addition in our childhood.
acb
bac
bca
cba
cab +
_______
2022
--------
From this we can do a little bit assume that addition of 3rd column should be 22. We write 2 and save 2 (or 20) for the 2nd colunm. Addition of 2nd column should be 20. Then 20+saved 2 = 22. We then again save 2 (or 200).
Addition of 1st column should be 18. Then 18+ saved 2 = 20
We can develop 3 simultaneous equations as below.
2a + 2b + c = 22
2a + b + 2c = 20
a + 2b + 2c = 18
Solve this and you easily get the answer
a = 6, b = 4, c = 2
I did it wayyyyyyyy simpler.
1) If adding the 5 new numbers together gives 2022, then 2a + 2b + c = ?2 ... can be 2, 12, 22, doesn't matter, we know we're dealing with even numbers and z has to be even.
2) Average of the 5 numbers has to be 404.4 (=2022/5). So the first digits (a, 2b, 2c) will average less than 4 (to account for the other two digits) but not far below. So either b or c will likely be 4, with the other not much less than 4 and a must be not much greater than 4.
3) And since we're dealing with even numbers, the most logical first guess would either be 642 or 624. Making 4 of the 5 numbers 426, 462, 264, and 246. Subtract them all from 2022 and the remaining number is 624...making the final permutation the answer of 642.
I solved the task exactly the same way as you 🙂
I used the same method
Another way to solve it is to use a system of equations and considering the carryover of the digits sum.
Calling N digits n1,n2,n3
Starting from
2022+(100*n1+10*n2+n3)=222*(n1+n2+n3)
Therefore
122*n1+212*n2+221*n3=2022
Then splitting into the sum of digits, we can consider
A) 1*n1+2*n2+2*n3+c2=20
B) 2*n1+1*n2+2*n3+c1=2+10*c2
C) 2*n1+2*n2+1*n3=2+10*c1
Where c1 and c2 are the carryovers for the sums
Then summing up A+B+C we get
5*(n1+n2+n3)=24+9*(c1+c2)
For the right hand to be multiple of 5 then c1+c2=4 (so there are 3 possibilities of c1,c2=(1,3),(2,2) or (3,1) )
Thus n1+n2+n3=12 or
D) 2*n1+2*n2+2*n3=24
Then doing D-C
n3=22-10*c1
So the only way 1
It's been long since I last had to pause the explanation and rewind it. What a complex solution for a problem that didn't look that hard to get to the general equation
Maths can solve everything but can never solve how man utd got a point at anfield in the form they are in and in the form liverpool are in
What are utd’s? No means to count how many you have until you define.
@@verkuilb it is a joke and typo about man utd drawing against liverpool at anfield
2022+x =0 mod 222; x=-24 mod 222. Check answers: 198, 420, 642,and 864 and find solution 642.
That's basically what I did. X=198 for me after the mod but those are the same number.
The sum of the six digits would be a multiple of 222 due to the summing of the 6 iterations of the digits with each digit twice in the hundreds, tens, ans ones positions. Aiming for 2220 gives us a difference of 198, but these digits' sum of the remaining 5 iterations is too high. Adding 222 to 198 ends in zero, which isn't usable in this problem, but adding 444 works and solves.
Easy ... found in less than one minute ... tried 10, 11, 12 times 222 minus 2022 and 12 times matches for a difference of 642
I solved this task using a guessing method. I tried 123, 246, 264, and 462 before realizing that the correct answer is 642.
A,b and c are unique. 2a +2b +c ends in 2. 126... no. 642... yup. About 10 minutes work. Fun little problem.
I accidentally did it mentally (after much fiddling and number figuring) for 2202 and then realized that the problem was for 2022, but then noticed hey I have to swap numbers such that the hundreds goes down by 2 while the tens go up by 2 so I knew I had the right 3 digits but picked the wrong number to “exclude” from the sum which was 462. Easiest way to flip it around correctly is to swap it with 642
Anyone else is noticing that the first 3 comments look made by the same person (bot)?
Same solemn flattery + 3 very random emoji at the end.
I haven’t seen those yet
Most of the comments are bots. 90 % bot comments, 10 % people. They just act like they are people. Same everywhere.
BEAUTIFULLY solved Presh.
In these type of exams, there is 1 point for verification of the solution.
So you should have included that!
After getting the equation, you know that 221c must result in a number ending in 2, hence c=2. Reduce the equation. Repeat for the tens digit etc.
(2022+N)/222=(a+b+c). 2022+N has to be divisible by 222, which means that N=198+222k. For this N, the formula gives result (a+b+c)=10+k. You get 4 options (198,420,624,864) and “digit sums” according to the formula (10,11,12,13). Out of those, 624 is the only option.
All six numbers sum to 222(a+b+c), and five of them sum to 2022. So the search is on for the smallest integer n ≥ 10 where 222n-2022 is a 3-digit number whose digits sum to n. And the search ends at n=12 because 222•12-2022=642 and 6+4+2=12. Therefore a=6, b=4, c=2; without the long tangent on congruence modulo 3.
MindYourDecisions gets a B- for this "solve" which completely ignores the logical deduction that none of the digits can be the same, and opts for a convoluted MOD(3) based approach that was completely unnecessary.
We know its gonna be approximately 400x5 so start with the 4. For each digit column we include one digit once and the other two twice. Cannot contain 2 odd numbers and make 22 so we skip 435 and go to 426. 22 is 66442 summed so final digit is 2. Excluding 4 gives 20, excluding 6 gives 18. 1800+200+22. Therefore 642.
Hello Presh,
I used Excel to solve this mystery number, with the following method;
1: 3 cells from left to right to hold each digit of the number - A1 to C1
2: 6 cells in column D to hold the calculated results of the numbers in A1 to C1 - =SUM(100*A1)+(10*B1)+C1, etc
3: 6 cells in column E to hold the sum of Column D, minus the cell to the right - =SUM($D$1:$D$6)-D1, etc
4: An OR function in F1 to find 2022 - =OR(E1=2022,E2=2022,E3=2022,E4=2022,E5=2022,E6=2022)
5: Start typing numbers in A1 to C1, until F1 says TRUE, then arrange them until the correct answer is in cell E1
6: Answer is 642
Thanks for a great video. I'm enjoying the content on your channel, and regularly give the problems a try.
Keep up the good work
Andrew
def find_number():
for a in range(1, 10):
for b in range(0, 10):
for c in range(0, 10):
N = 100 * a + 10 * b + c
# Generate the five permutations
perm1 = 100 * a + 10 * c + b
perm2 = 100 * b + 10 * a + c
perm3 = 100 * b + 10 * c + a
perm4 = 100 * c + 10 * a + b
perm5 = 100 * c + 10 * b + a
# Sum of permutations
total = perm1 + perm2 + perm3 + perm4 + perm5
if total == 2022:
return N
return None
result = find_number()
print("The value of N is:", result)
The mod 3 is massively overcomplicated.
Much simpler sulution: once you realize that the 222 (a+b+c) relationship, just start by elimination.
If a+b+c = 10, the sum of all 6 numbers is 10 x 222 = 2220. The mystery number would need to be 2220-2022 = 198. But its digit don't sum up to 10. So not this one.
If a+b+c = 11, the sum of all 6 numbers is 11 x 222 = 2442. The mystery number would need to be 2442-2022 = 420. But its digit don't sum up to 11. So not this one.
If a+b+c = 12, the sum of all 6 numbers is 12 x 222 = 2664. The mystery number would need to be 2664-2022 = 642. Its digit sum up to 12! BINGO!
Go further to find if this is the only one...
took about 25 seconds in Excel to solve. 🙂
I did the same thing lol
But I had a typo so it took me significantly longer 😢
Solve this in a min through basic logic - was clear that the average number needed to be around 4, and that you could have hundreds, tens, and ones sums of 18, 20, and 22; with this in mind, you make sure that the difference between the transposed ones and hundreds spot was 4 and that the omitted tens was 4 as well, leaving only 6-4-2.
7:07 it’s 100a not 10a, great video tho
oh wow modulo used it in high school and a few times at work to simplify some problems Thanks Presh that one reawakened modulo for me
Fairly easy to guess. Instant observation is that the sum of 2022+N is going to be divisible by 222, with the first candidate being 2220 which would make N equal to 198. This can be discarded as (9+8)*200 is already much larger than the target. Next value for N will be 420 which can be discarded as well because (2+0)*200 is much too small. Which gets you to 642 as the next in line and gives the correct result. In hindsight I found that it was in fact even simpler and wouldn't even require validating the sum of the permutations as all you need to check is whether the sum of the digits matches the factor of 222 for the target number 2022+N
The methods allowed in the competition presumably require the problem to be solved with pencil and paper (if not in head). However, a direct attack led me to derive the coefficients of a, b and c in the equation 2022=ax+by+cz as 122, 212 and 221 respectively, based on the consideration that a cannot appear twice in the 100s column etc. The solution comes from the reflection that there must be some combination of choices of b and c such that the difference between 212b and 221c is divisible by 122 (and similarly for the other combinations). As luck would have it, this method quickly yielded 6 as the value of a etc. But it couldn't be done this way in competition conditions, I imagine. On the other hand, I don't feel too bad about it, as the method using modular arithmetic also required trial and error and quite a lot of calculation.
Let the 3 digit number be 100a + 10b + c where a,b,c are the digits, then:
(100*a+10*c+b) + (100*b+10*a+c) + (100*b+10*c+a) + (100*c+10*a+b) + (100*c+10*b+a) = 2022
Which simplifies to 122a + 212b + 221c = 2022 where integer solutions for a,b,c are 6, 4, and 2.
That needs a little bit of guessing, right? I did the same. The only thing I added is that if you divide 2022 by 5 to get the average of those 5 numbers, you get 2022/5=~404, so the middle digit is most likely a '4'.
I didn't calculate this, but was planning on something like your solution. First thought I had. Then decided to sneak view the solution.
@siavashakrami3444 It might take a lot of guessing to do the last step yes, but I was showing a method that simply proves it's 6, 4, 2 and nothing elelse, not necessarily the easiest or fastest way but I think the easiest to understand. I don't think dividing 2022 by 5 means the middle digit is most likely to be a 4 though.
@angelavonhalle5144 Yes I sneak view the solution a lot after I know how to solve the problem but don't actually want to do the work to do it.
If 122a + 212b + 221c = 2022 you can deduce that c is even which simplifies the search a bit.
MOD is not in any school maths. Solution: for N=abc and to get ∑(acb+bac+bca+cab+cba)> 2000, and last digit 2, either 2a+2b+c=12 OR 22, BUT from 2022, first column 2 means carry must be 8, impossible. Thus 2a+2b+c=22, 2a+b+2c=20, a+2b+2c=18. By subtraction, a-b=2, b-c=2, a-c=4, THUS all even, all different, none zero. Solution can only be EITHER 864 OR 642. By substitution into 2a+2b+c=22, answer is 642
Interestingly, the sum of the 5 new numbers produces 900 unique solutions, one for every original number. The sum of the 6 numbers does produce only 27 solutions as alluded to in the analysis.
Where the follow up, showing the "so called" answer actually works???
Took me 15 minutes with pencil and paper, trial and error with reasonable start numbers.
Wild, I took a completely different approach.
N = 3 digit number. So each digit must be between 0 and 9.
They can be rearranged to form 5 new numbers. So none of the digits repeat.
Of these 5 numbers we we know one of the reverse pair, the N. Isnt in the sum. So for the last digit, ABC. C must only occur once. We know 2 is the sum of single digit number. Only two numbers can give you 2 for C. 2 or 6. We also know that the other 4 numbers, 2a+2b must be equal to 20 or a+b =10. So we have 2, 6, and X. We also know the middle number or B, only appears one in the middle summation. 22 is already creates by 2a+2b+c, that means 2a+2c+1b must be equal to 0. Using 6 and 2 as our possible c we're left with 4 as our B thus locking in 2 for c and 6 for A. 642.
8:50 642 is not the solution its one of the 6 solutions, the other five are the combination of 642
No, 642 is the only solution. The requirement is that the five permutations of N add up to 2022. 642 is the only value for N where that works.
@gavindeane3670 yes, since N is not specific no., it's just three digit no, which All the other permutations satisfies just as 642. And all other five number have the same permutations. It just shuffle of same three number.
@@GsBabu-sk6iv Only one of the six permutations will satisfy the equation
222*(a+b+c) = 2022 + N
(a+b+c) is the same for each of the six permutations (namely (a+b+c) = 6+4+2 = 12 ), but N will be different for each permutation; so only one N will satisfy.
@@yurenchu yes, but the question is not asking for that specific N, it clearly wants numbers whose digits are permutations satisfying the equation. The equation which has to be satisfied is specific, the N is not Asked specifically, hence the solution is the 'Set of permutations of N'. N is just a notation of understanding.
@@GsBabu-sk6ivThe question is asking for that specific N. It literally says "What is the value of N?"
The five numbers that are NOT N sum to 2022.
You do realise there are six 3-digit numbers here, right? N is one of them. The other five are the five other permutations of the digits of N.
You can also tell that abc is even, because the sum of all six permutations is a multiple of 222, which is even, and the sum of all except abc is 2022, which is also even. So abc is a multiple of 6.
I wrote a quick program to search through the numbers from 000 to 999. It found 642. It took a few minute to write the program and < 1second for the program to find the answer.
Digit sum = (2022 + N)/222 = 9 + (24+N)/222.
It must be an integer, of course. And N is positive and less than 1000.
So we check N = 198, 420, 642, 864 looking for digit sums 10 through 13 respectively. And 642 is the only one that works (the expected digit sum of 12 indeed matches 6+4+2).
4:33 can someone explain this part?
222(a+b+c)=2022+abc
We can easily know 9 < a+b+c < 14, because 222x9 = 1998 < 2022 , 222x14 = 3108 > 2022+999. So we only need to check for a value of a+b+c=10, 11, 12, 13.
The problem for me is the definition of "swapping" digits. To me this is different from simply arainging the digits in a different order, but instead would imply exchanging the positions of two of the digits. So if N is abc, then the available swapped values are bac (a & b swapped), cba (a & c swapped), and acb (b & c swapped). Any other araingements require moving a digit from the front to the back (abc -> bca) or back to the front (abc -> cab) operation instead.
It's very normal phrasing in English, albeit colloquial, to say that you can swap the digits of abc around to get, for example, cab, but I noticed the same thing as you. It felt like more informal, imprecise wording than might be expectef in a technical question like this. But given that "swapping" creates five new numbers, it was obvious what was meant.
@@edwardblair4096 Start from
N = [abc]
... swap a and b ...
--> [bac] = M1
... swap b and c ...
--> [cab] = M2
... swap a and b ...
--> [cba] = M3
... swap c and b ...
--> [bca] = M4
... swap b and a ...
--> [acb] = M5
There you go , five new numbers: M1, M2, M3, M4 and M5 !
Since a, b, and c are all different numbers, shouldn't a+b+c fall between 6 and 24 inclusive?
Oops, I forgot about 0. But if 0 were one of the digits then two of the numbers would have only two digits. That wouldn't fit in the problem as stated, so my observation is valid.
Going from the thumbnail I grabbed a piece of paper and came up with N = 642
But once I came up with the coefficients 122a + 212y + 221z = 2022, I bruteforced the possible values of x, y, z (up to 1000 options) with a script to get the answer.
I did the same method, but the first set of values I tried was x=3 y=2 and z=1, which game me sum of 1011. Since that's half of what I needed, I just multiplied it by 2 and got the answer.
I took your formula, solved for the formula for z, and then bruteforced the 9x9 grid of possibilities with a spreadsheet. Only 1 value had an integer result. (I eliminated 0 as a possible digit value, as I didn't think that 0ab qualified as a three digit number)
Hard one. I don't know where you got the modulus trick, good lesson. But it'd be cleaner if you enforce a != b != c: or you couldn't have 6 combinations. So max would be 987 in the end parts, etc.
How did you comment 4 days ago even though the vid came out 6mins ago?
@@aastavchoudharySubscribers get early access to most of his videos, and can comment at that time.
Yup. The 3 digits can not be equal is one hint and the sum of 5 permutations is even (>2k) is another. These 2 can be put together to get the combination right.
Paused. If we express the digits of N as "htu" for Hundreds, Tens, and Units, (not using O for ones as it looks like a zero), then we would get these five permutations:
hut
uht
uth
thu
tuh
Because we exclude the number N itself, the htu permutation isn't included. But across all permutations, each digit would occupy each column twice. If you exclude N (htu) then the hundreds digit (h) would occupy the hundreds column only once, but the tens column twice, and the ones column twice. Likewise the tens digit (t) would occupy the tens column only once, but the hundreds and ones columns twice. The units digit (u) would occupy the ones column only once, but the hundreds and tens columns twice. Since 2022 is a sum of the 5 permutations and we know how many times each digit is allowed to occupy each position, we can write a formula for the whole expression like so:
(100h + 20h +2h) + (200t + 10t + 2t) + (200u + 20u + u) = 2022 -> combine like terms:
122h + 212t + 221u = 2022
Now I note that the coefficient for h and t are both even, which means that if you deduct 221u from 2022, you can automatically exclude certain values of u because they would yield an odd number, and no even numbers will add up to an odd number. So for example if the units digit was 1, then 2022 - 221x1 = 1801, and there is no way to split 1801 into a stack of numbers that are all divisible by 2. So if we try each possible value for U, we will find that we only get an even number when 221u is deducted from 2022 when U itself is even... 221 ends in 1 so 221 times any odd digit will also end in that odd digit. So U can only be 0,2,4,6 or 8. We can refine this a little further because 221x8 is 1768, and if you deduct that from 2022 you get 254 which is smaller than 122+212, and not divisible by either 122 or 212.
At this point I just brute-forced the problem, because with U being 0,2,4, or 6, the number of possibilities remaining gets reasonable. With a given U, if I pick a value for T and deduct 212T from (2022-221U) I should get a value which is a multiple of 122 which seems like it would be pretty easy to spot. If U is 0, no value of T works, but if U is 2, and T is 4 you are left with 732 which is 6x122 which means H should be 6. 122x6 + 212x4 + 221x2 = 2022, so N is 642.
Simpler to avoid mod function, 221a + 212b + 122c = 2022 and a must be even 2,4,6 or 8. For a=2, 106b+61c=790. Try values of b, example for b=6, 61c=144 won't work. Try b=4, c=6. Solved.
Right off, I have a confusion or a contradiction. You begin by counting permutations of abc. But the question asked was about swaps. The swap of a with b and the swap of b with a are the same. The swap of b with c and the swap of c with b are the same.The swap of a with c and the swap of c with a are the same. That's all the possible swaps. The only way you can get 5 swaps is by getting from abc to other permutations using multiple swaps.
It's normal in English to say you can swap the digits abc around to get acb and bac and bca and cab and cba, but it is informal, colloquial, imprecise language. Once you read that we're creating five new numbers it's clear what he means by "swap", but in a technical question like this you'd expect more precise language.
222(a + b + c) = 2022 + N
=> N = 222x - 24
Try x by [1, 2, 3, 4], then the correct answer is x = 3, N = 642
2022 / 222 > 9, and 3022 / 222 < 14, so 9 < a+b+c < 14. The only choice that is divisible by 3 is 12. So 222 * 12 - 2022 gets the answer quickly
I had a different approach. Since 2022 ends in even number and there should be five last digits that when added together must be the result an even that means that all of the digits of N are even.since at average the sum is 404,4 ( 2022 /5 = 404,4 ) then that means that the digits should be 2, 4, 6 because if multiplied by 100 they fall around 404,4. So you add the 5 most logical numbers that are created by those 3 digits and you find out the result is 2022
Figured there were 221 As, 212 Bs and 122 Cs. Guessed at a couple of A and B options until I found a C that added up properly. Faster than Presh, but he was making a video, so he'd have beaten me to death, I'm sure.
Suddenly I thought am I colour blind? 😅
There is another way.
2(a+b)+c=2
2+2(a+c)+b=2
2+2(b+c)+a=0
3 eq, 3 variables
Gestimations lead me to conclusion that on avarage this should be 404,4
I guested that it should be around 400, 600, 600, 200 and 200 so on average will go down to 400, but forgot about extra digits :)
222 helped to find last piece of the puzzle
I guess my solution method was suboptimal, but I found it a lot easier than all the mod 3 stuff and keeping the disallowed permutation in the solution.
Here's how I solved it:
N + 2022 = 222(a + b + c)
Since 2022 is 6 more than a multiple of 9, it follows that N is 3 more than a multiple of 9. Since N is 3 more than a multiple of 9, so is the sum of its digits; that is, a + b + c = 9n + 3. Proceeding from there:
N + 2022 = 222(9n + 3)
N + 2022 = 1998n + 666
N + 1356 = 1998n
n has to be 1(because n = 2 requires N to be a four-digit number), so N = 1998 - 1356 = 642.
The question in the title of your video is, “Can you solve for the mystery number?” Therefore, the answer is NOT 642-as the question is in binary “Yes/No” form. In my case, the answer is “Yes”-but anyone who was unable to determine 642 on their own would be giving a CORRECT answer if they replied “No”.
well that's the answer to the question of the video's title, not the question inside the video to which he is answering
but yea you can indeed solve the title's question with a "yes/no"
You are of course *technicaly correct* , The best Kind of correct 😁
Try that in an important maths exam and let me know how you get on!
@@Mike-H_UK most important science exams at high level that i've had don't ask you "are you capable of doing this?" anyways lol
The title specifies if you Can, not if you Did. So, a large chunk of people who answered No may be wrong simply because they didn't try all the possibilities.
I haven’t yet watched the video… took me a little while to work out how best to approach it, but here’s how I finally solved it…
Rewrite N as 100a+10b+c.
The sum of all six numbers representing all six arrangements of the digits is 222(a+b+c).
We want the sum of just 5 numbers (excluding 100a+10b+c), so 222(a+b+c) = 2022+100a+10b+c = 2022+N.
Therefore 2022+N is divisible by 222.
Therefore (a+b+c)=[10, 11, 12, or 13].
I tested for each possibility, noting that 222*[given possibility]-2022 must result in a 3 digit number (thus excluding possibilities greater than 13) whose digits sum to [given possibility].
The only possibility that passed this test was 12.
222*12-2022=642.
Therefore N=642.
If there is one concept in mathematics that I hate working with, it is modulo arithmetic. Is there some good way to learn and work with it?
A bit old, but H Davenport the higher arithmetic is very readable and introduces modular arithmetic and some pretty deep results. I read it at 14 and it helped get me a degree! Davenport was the supervisor of John Horton Conway (RIP) who invented the game of life cellular stuff. HTH.
This is wrong, right? I mean, it's correct but that is not the answer. In 0:16 Presh says "If we add there FIVE number we get 2022". Only the 5 new numbers, not ABC. We get 122*a + 212*b + 221*c. Now what?
That's a lot of maths, I just used excel last digits of the 5 needed to add to 22, middle digits to 20 + carried 2, and the first digits had to add to 18 + carried 2. wasn't hard to tweak the numbers. Got the answer in 3 mins. Who needs maths when you have excel.
I got this but totally more roundabout.
First I looked at 2a+2b+c = ?2. So it's either 12 or 22 and c is even. With c being even, 12 requires 1 3 2 or 3 2 1 which doesn't work for the rest of the problem.
Then realize there must be carrying so I split the columns: the ones column adds to 22, carrying 2.
The tens column adds to 10 or 20, with a carried 2. 10 is impossible with 2x+2y+z, so is had to be 20. also b must be even.
The hundreds column adds to 18, (a is also even)
so the columns are 18, 20, 22 . The lowest 2x+2y+z using 8 is 2*8+2*2+4= 24, so 8 is a no-go. The remaining even numbers are 2 4 and 6. each of the three columns is missing a number, the ones is missing the smallest one, and the hundrens missing the largest. so 642. Yeah.. really convoluted but it works
I don't think I ever understood this part of my algebra instruction.
"Modulo N" just means "considering only the remainder of the division by N", for example 1234567 = 7 mod 10.
The nice thing about modulo arithmetics is that many things mostly work out exactly as you might hope, in particular addition, multiplication, and powers all work just fine. For example if you want to compute 123 * 457 modulo 10, you can just compute the modulos of each number first (123 = 3 mod 10, and 457 = 7 mod 10), and then multiply them. Therefore:
123 * 457 mod 10
= 21 mod 10
= 1 mod 10
You can even compute huge powers modulo N very efficiently, even by hand. This is used heavily in cryptography. For example:
1234567^9876543 mod 10
= 7^9876543 mod 10
= 7 * 7 ^ 9876542 mod 10
= 7 * (7^2)^4938271 mod 10
@@mouduge Can be done quicker:
7^4 (mod 10) = 49^2 (mod 10) = (-1)^2 (mod 10) = 1 (mod 10)
9876543 = 43 (mod 4) = 3 (mod 4)
==>
7^(9876543) (mod 10) =
= 7^(4k + 3) (mod 10) , for some positive integer value of k
= (7^4)^k * (7^3) (mod 10) , for some positive integer value of k
= (1)^k * (7^3) (mod 10) , for some positive integer value of k
... note: (1)^k = 1 ...
= (7^3) (mod 10)
= (343) (mod 10)
= 3 (mod 10)
So we have a number of 6 valid distinct numbers by permuting the digits. This means every digit is distinct and Nonzero.
Each digit appears in every position 2 times so the sum of all the numbers should be 2*111*(a+b+c)-100a-10b-c=2022
122a+212b+221c=2022
Since 122, 212 and 2022 are even then c must be even so either 2,4,6,8
I c=2 => 122a+212b=1580
61a+106b=790
So a must be even too and different from c.
a=4 => 106b=546 false
a=6 => 106b=424 b=4 624 answer
a=8 => 106b=302 false
II c=4
122a+212b=2022-884=1138
61a+106b=569 so a is odd
a=1 106b=508 F
a=3 106b=386 F
a=5. 106b=264 F
a=7. 106b=142 F
III c=6
122a+212b=2022-1326=696
61a+106b=348
a=2 106b=226
a=4 106b=104
c=8 122a+212b=2022-1768=254 not possible
I was once asked as to what the difference between an educated person and an intelligent person is. An educated person would tell you that 2+2=4. An intelligent person would tell you why that is.
@@scottwestleysmith3196
"Great minds discuss ideas; average minds discuss events; small minds discuss people."
- Eleanor Roosevelt.
Redundant
S = 2022 + 100a +10b+c = 222(a+b+c)
so 2022
"222 is clearly a multiple of 3..." Is that supposed to be clear? You make a lot of assumptions like that, Presh. Things that are clear/obvious to you may not be to someone else.
@@Doc_Fartens When M is an integer, then
{sum of digits of M is divisible by 3} ⇔ {M is divisible by 3}
So, 222 is divisible by 3 because 2+2+2 = 6 is divisible by 3 .
This video would have to be an hour for me to understand
eazier with no mod 3:
(a+b+c) =x
222x = 2022+ N
for x = a+b+c = [10, 11, 12, 13] we have
2022 + N = [2220, 2442, 2664, 2886] and
N = [198, 420, 642, 864], the third option is correct, i.e. a+b+c = 12 and N = 642
Why couldn't it be 2022 /5 /3? There's 3 numbers, 5 numbers, equally 2022....
Pretty sure that Presh is now giving us inefficient answers to drive engagement in the comments. I guess you have to do what you have to do on YT. Just a shame really.
Why is 222 "clearly a multiple of 3"? What rule allows us to determine this easily?
2+2+2 = 6 and 3 | 6 (read: 3 divides 6)
Rule of 3: any multiple of 3 whem its digits are summed up, will sum to a multiple of 3
@@Konanzor if M is an integer, then it turns out (and it's easy to prove) that
{ sum of digits of M } ≡ M (mod 3)
So if M is a multiple of 3 , then M ≡ 0 (mod 3), and hence also
{ sum of digits of M } ≡ 0 (mod 3)
or in other words, the sum of digits of M is also divisible by 3 .
Example: the sum of digits of 222 is 2+2+2 = 6 , which is divisible by 3 , and hence 222 is also divisible by 3 .
A similar rule applies for divisibility by 9 .
I'm sick and it's late over here. But out of my hat: the Digits must be different from each other or you couldn't form new numbers. Also all 5 together give 2022, so without checking it i would say it's likely that the high digits 7, 8 and 9 aren't included because that would give to high of a sum.
What confused me was the word 'swapped'.
Thinking you could change one of digits for any other digit.(0-9)
Maybe it's in the translation from French to English?
Maybe should have used the word 'rearranged'
"Swapped" is a bit casual and informal. He could have said that but more carefully. "Rearranged" would have been good.
Took me like 5 minutes of brute force after 2 min of eliminating a few numbers
The brute force method was more satisfying than all this mod stuff.
I managed to get to
122a + 212b + 221c = 2022
and we know that all a,b,c are digits between 1 and 9 (both included).
So there are 729 possibilities... (1,1,1), (1,1,2),....all the way to (9,9,9)
So I used my computer. And only one possible solution is 642.
I thought the video would be about some clever trick to shorten this pool of 729 options to something manually manageable.
Instead, it was more complicated. So I am more satisfied with my way of solving it.
I shortened it to 4 options I could do without paper.
Your 122a+212b+221c is actually simpler put as 222(a+b+c)-N
N=222(a+b+c)-2022
Since N is limited to exactly 3 digits, 10≤(a+b+c)≤13.
Only 4 options to test for N: 198, 420, 642, 864.
Immediately we can see 6+4+2=12 is the only solution within the range giving N=642 as the only solution
Python:
[(a,b,c) for a in range(10) for b in range(10) for c in range(10) if 222*(a+b+c)-100*a-10*b-c==2022]
nice!, i did
from itertools import permutations
def find_number():
for n in range(100, 1000):
digits = str(n)
perm = set(permutations(digits))
perm_numbers = [int(''.join(p)) for p in perm]
if len(perm_numbers) == 6 and sum(perm_numbers) - n == 2022:
return n
result = find_number()
print(f"The value of n is: {result}")
Big brain. One liner, loving it! But I have to mark you down for the output format. Can you do the actual number without the commas?
@@msromike123 Thanks! Challenge accepted:
[100*a+10*b+c for a in range(10) for b in range(10) for c in range(10) if 222*(a+b+c)-100*a-10*b-c==2022][0]
Or if you want to confuse readers, you could replace 100*a+10*b+c with int(f"{a}{b}{c}")
How you determined the 100 a , 10 a?
I think the solution in the video is over-complicated.
If N is the number and D is the digit sum of N, then we have
222 × D = 2022 + N
The maximum possible value of N is 987 so the max of 2022+N is 3009
Therefore 222×D must be between 2022 and 3009. That gives only four possible values for D: 10, 11, 12 and 13.
It's easy to check those four options for D to see whether the digit sum of N is equal to D. Only D = 12 and N = 642 works.
The average of the numbers is 337...
That's about as far as i got
A 3 digit number can be "swapoed" into 6 new numbers! Choose fire of them? Terrible complicated
Cba is definitely the correct anwser.
Im a bit sad that in my whole formation from school to high school to university of engineering i have never studied congruences
Why do you assume it's 100 why not 134.80?
This is what python is for?
Your solution is very nice but too complicated.
There is a shorter solution.
1) write the sum as:
acb
bac
bca
cab
cba +
------------
2022
2)call right column LC, LC=a+2b+2c
center CC, CC=2a+b+2c
left RC, RC=2a+2b+c
3)note that since LC is even c has to be even (2,4,6, or 8)
4)RC couls be 12,22,32, or 42
5)CC-RC=c-b note that -7
Fun! But you started out by saying this was for 15-16 year olds. They would NOT be able to do this (I have studied math for 3 ys at the university and we never ever saw the "modulo-thing"). You should have deducted that there was a much easier way! :)
Welp as someone round that age group I didn't do it in any complex manner, I simply started with high numbers and low numbers and eventually finding a median (my closest was 543, I did try 642 iirc however I rearranged the numbers wrong hence not getting the right answer), if the product was high, I'd subtract a high order number (essentially excluding it and making it seem like the original number) if the product was low, I'd subtract a low order number and do the same thing, the worst part was that I tried the correct number yet in the wrong way
They might not be able to do it by Presh's method, but nobody needs to do it by Presh's method. It's way over-complicated.
Adding up the 5 possibilities, I got the equation 122a + 212b + 221c = 2022. Since 2022 is an even number then "c" must also be an even number in order for the the left side to add up to even. Therefore, c must be the number 2, 4, 6 or 8. Using trial and error, I start with c = 2 which means "b" must be less than 8. Plugging in numbers less than 8 and solving for an integer value for a, it worked out that b = 4 and a = 6. So, I got very lucky with the first round simply using c = 2 😉
I used the same method! Except I started at c=8 and worked downwards so it took me a lot longer 😞
@@ceejay0137 👍
Hi, if is possible to include zero, and making swapping of 6 to 9 (vice versa); would it be possible to find a combination whose sum is 2022?😅
I solved it next way. Five numbers gives us 2022. So the medium of this numbers is around 400. So i supposed we are searching for a number abc with (a+c)/2=4 and b=4. So firstly i checked 345 and it's variations (354, 453, 435, 534, 543), found the sum of all 6 numbers and try to decrease the sum by one of them to get 2022. I got no luck. So then i checked 246 and (246+264+426+462+624+642)-642 gives me 2022. That's it! (I know this is not correct mathematical way to solve but still i found the answer very quickly)
For once I started out on the right track. Then I cheated and used Excel!
I was getting there by guess and by golly. I knew a+2b+2c was somewhere around 18ish and c was definitely even. I had tested 552, 454, and 452. So I was closing in. But doubt I could have done it with anything but brute force. I should have known 454 was not a contender though.
1:41: Leaving the _c_ terms in white … um … saves ink?
😉