New POTW Posted

The title pretty much says it all. I have a new teaser for you, along with some discussion of palindromes that you might enjoy. The solution to last week's problem has been posted as well. Let me know what you think!

More like this

Interestingly not a single one of the solution to POTW2 remotely resembles my answers. :)

Here's what I got:

1. (17 - 6 - 5 + 2) * 1 = 8
2. (20 * 9)/(15 + 4 - 1) = 10
3. 5! / (21 - 6 - 3 - 2) = 12
4. 5^(23 + 7 - 19 - 11) = 1
5. sqrt(18 / (25 + 20 - 21 - 22)) = 3

Now for the new one!

Hmm, problem 3 was surprisingly easy. Are there multiple solutions?

It is interesting though; I found simple reasoning quickly gives you what the first and last digit must be, and that in turn means there are only 5 possibilities for the second digit, which means you can quickly solve for the only second digit that gives a viable third digit.

Well, some problems are harder than others. There's only one solution to this one. Perhaps next week's problem will be more challenging for you. Hope you liked the palindromes, though.

By Jason Rosenhouse (not verified) on 14 Sep 2014 #permalink

Oh, don't get me wrong, I still enjoyed it. But thus far I found Week 1 (with the extended number sequence - I never did get 31 until it was posted) the hardest.

The Schwarzenegger palindrome was amusing. :)

Just as an aside - I hope none of your students cheat. This week's problem is exceptionally easy to brute force with a computer.

Gazza,
My 2-4 don't resemble yours at all, either. My #1 is the same. After that, it goes:
2. (9+1)*(20-15-4)
3. (21+3)*(6-5)/2
4. (19+5-23)^(7+11)
5. (25-22)*((21-20)^18)
A basic rule of thumb for these seems to be: get the answer using a subset. Then try and make the remaining numbers into a 1 or 1^N, where N can be the sum of any numbers you haven' figured out what to do with yet.

Oh, don’t get me wrong, I still enjoyed it. But thus far I found Week 1 (with the extended number sequence – I never did get 31 until it was posted) the hardest

Week 1 wasn't hard as written. What we struggled with was the numbers higher than 10 - but the students didn't have to solve for those.

GAZZA,

Actually, it is possible to get all the digits by mathematical reasoning without resort to any trial and error. Of course, in the interest of allowing Jason's students (and anyone else who might want to come up with it on their own), I will not post any more until next week after solutions are due.

Have you checked Jason if there is any form of general theory that generalizes the problems?

For which n is there a n-digit number that reverses when you multiply by 4?

Sean T@8: Yes, indeed. However, once you get the first two digits, trial and error doesn't take very long when you're looking at the third (and in my case, it was quicker for me to do a couple of quick sums rather than continue the change of reasoning).

Sounds like we solved it in a similar manner, Gazza. I got two digits very quickly, narrowed a third one down to two choices, then figured out which one it was, then got the last digit by trial and error.

Oh, I have no doubt that the trial and error method works just as quickly (or even more so) than using mathematical reasoning to get all 4 digits. I just took it as a challenge to myself to see if I could get the entire number by reasoning alone without resort to trial and error. I actually did get the number by trial and error first, and then figured out the reasoning after the fact.

I just took it as a challenge to myself to see if I could get the entire number by reasoning alone without resort to trial and error. I actually did get the number by trial and error first, and then figured out the reasoning after the fact.

Its often much easier to solve a problem when you know the answer. :) Though I did the same thing; tried to figure out after my brute-force approach to the last digit what a more analytical method of figuring it could be. Turned out to be just a couple of easy steps, I was just lazy and didn't try when I should have.

Rivelate Anne Hathaway riprese di The Intern a Manhattan, e che

By fabushqgesfv (not verified) on 21 Sep 2014 #permalink

Here's my solution. I'll be curious to know if others did it the same way.

We are solving for ABCD where 4*ABCD = DCBA.
1. Since DCBA < 10,000, ABCD < 2,500. That means A = 1 or 2.
2. A /= 1 because there is no D for which 4*D = an odd number. So A = 2. Side note: since A = 2, and ABCD < 2,500, we also know that B 7 because A*4 must be 8 (if there’s no carry-over from 4*B) or 9 (if there is a carry-over from 4*B). Note that it’s not possible for A to “roll over” and have D be a lower number, because that would mean we have produced a 5-digit number.
4. Since D*4 = some number EF where F=2, D must be 3 or 8 (so 4*D = 12 or 32). Combining this fact with #3 tells us D = 8. To recap, so far we know that our number ABCD is 2BC8 and B<5
5. Since 4*D = 32, B must be odd. This is because 4*C+3 (the carry-over from 4*D) must be odd. In step 2a we found out that B 3. So C=7.

And so we arrive at ABCD = 2178

7. Last step (don’t forget!) is to check it by doing the multiplication. And yes, we find 2178*4 = 8712.

Hmmm...a cut and paste error seems to have chopped out part of step 2 and combined it with step 3. They should read:

"Side note: since A = 2, and ABCD < 2,500, we also know that B 7 because A*4 must be 8..."

Arg it did it again! Sigh. The symbols are obviously being misinterpreted as html commands.

The step 2 side note is that we know B is less than 5.

Step 3 is: Since A equals 2, D must be greater than 7 because A times 4 must be 8 or 9. Its not possible for D to be lower, because that could only occur if A 'rolled over' but then we have a 5-digit number, which is not allowed

And now I see there is a similar HTML mixup forther on. This is annoying and I apologize to everyone for my multiple posts. Here's the complete logic, replacing all of the greater than and less than signs with words:
***
We are solving for ABCD where 4*ABCD = DCBA.

Step 1: Since DCBA is less than 10,000, ABCD is less than 2,500. That means A = 1 or 2.

Step2: A /= 1 because there is no D for which 4*D = an odd number. So A = 2.

Step 2a: Side note: since A = 2, and ABCD is less than 2,500, we also know that B is less than 5. We will put this info to the side for now, but use it later.

Step 3: Since A=2, D is greater than 7 because A*4 must be 8 (if there’s no carry-over from 4*B) or 9 (if there is a carry-over from 4*B). Note that it’s not possible for A to “roll over” and have D be a lower number, because that would mean we have produced a 5-digit number.

Step 4: Since D*4 = some number EF where F=2, D must be 3 or 8 (so 4*D = 12 or 32). Combining this fact with #3 tells us D = 8. To recap, so far we know that our number ABCD is 2BC8 and B is greater than 5.

Step 5: Since 4*D = 32, B must be odd. This is because 4*C+3 (the carry-over from 4*D) must be odd. In step 2a we found out that B is less than 5, so B must be 1 or 3. But B cannot be 3, because there is no single digit C for which 4*C+3 = E3. So B=1. To recap, so far we know our number is 21C8.

Step 6: At this point I brute-forced it. But in hindsight an analytical solution would be: 4*C+3 = FB (and we know B = 1, so it’s really F1). There are only two choices for C, 2 and 7 (yielding 11 and 31, respectively). But it cannot be 2: the carry-over from 4*D is a 3, so C must be greater than 3. So C=7

And so we arrive at ABCD = 2178

Step 7: last step (don’t forget!) is to check it by doing the multiplication. And yes, we find 2178*4 = 8712.

My reasoning was similar, but not identical. Using the same nomenclature as you (ie we're looking for ABCD):

1. Observe that neither A nor D can be 0. If they were, it wouldn't be a 4 digit number.

2. A must be even, in fact. If you multiply any number by an even number, you get an even number, which means that if we multiply by 4 and end up with A as the last digit, it must be an even number.

3. Now, the only even number you can multiply by 4 and end up with a single digit - necessary, for the result to be a 4 and not 5 digit number - is 2. So, A = 2.

4. Now, we need 4D such that the number ends in a 2. Only D=3 (4D = 12) or D=8 (D=32) work. But it can't be a 3, since with A = 2 we have, at a minimum, 4 * 2000 > 3000. So, D = 8.

5. Like you, I brute forced it from here, but I did make a couple of observations. Firstly, observe that 4BC + 3 cannot produce a carry, as that would make the result >= 9000. We also note that, since 4C + 3 must be an odd number, and therefore B must be odd.

6. Well, if you try B = 1 - the smallest odd number, and the one I tried first - then we see that 4C + 3 ends in a 1, so C is either 2 or 7. If it were 2 (there is no rule saying the digits have to be unique), then we'd have 2128 * 4 = 8512, so that's wrong. But C = 7 gives us 2178 * 4 = 8712, as required.

I used similar, but again non-identical reasoning. Like eric above, it was easy to get the first and last digits, and I won't repeat the reasoning. Suffice to say, first digit is 2, last is 8. To get the middle two, let the original number be equal to 1000*a + 100*b + 10*c + d, where a,b,c and d are the digits comprising the number. Then, by the definition of the problem, 4000a + 400b + 40c +4d = 1000d + 100c + 10b + a. Now, substituting 2 for a and 8 for d, we get
8032 + 400b + 40c = 8002 + 100c + 10b. Manipulating algebraically, 390b - 60c +30 = 0. Dividing by 30 gives
13b - 2c + 1 = 0, or equivalently 2c - 13b = 1. Since 2c is an even number, 13b must be odd, since the difference of two even numbers is even. Since 13b is odd, b must be odd. As correctly pointed out above, b cannot be 5 or greater, so it must be either 1 or 3. It cannot be 3, though, because that would give 2c - 39 = 1, which implies that 2c = 40 or c =10 which is impossible since c must be a single digit. Therefore, b=1 and 2c - 13 = 1, which implies c =7. Thus, the original number is 2178, and 2178 * 4 = 8712.

Sean, I like your calculation of 2c - 13b = 1. From there, it is fater to skip the next two sentences and point out that for c to be less than 10, b must equal 1 which allows you to solve for c.

Good point eric. I totally agree; that would be much simpler and more elegant. I just didn't think of it when I considered the problem.

I would say, however, that solutions such as we've posted here would seem to be much more in the spirit of the POTW than simply submitting the answer without any reasoning. After all, it's pretty easy to use an Excel spreadsheet or some other computer method to just figure the answer out by trial and error.

The fourth POTW is up. Just follow the link provided in any of Jason's messages and you'll see the fourth gray box now has a hyperlink active in it.

Summarizing: Find a three-digit number that is equal to the sum of the factorials of its digits. (illustrative example: a 5 digit number that fulfills this criteria: 40585 = 4! + 0! + 5! + 8! + 5!)

I saw POTW four and have arrived at a solution, with only a minimal amount of trial and error. I ran into a step with an equation that I don't know how to solve analytically. While this particular equation was solved easily by trial and error, I would like to see if anyone can help me with a more general method for solving such equations. I will post in more detail on Monday.

If anyone is still paying attention, here is my solution to POTW 4:

The problem states that the solution is a three digit number which is equal to the sum of the factorials of its digits. This immediately excludes the digits 7, 8 or 9 from being part of the number since the factorials of those numbers all are greater than 999. 6 is also excluded because 6! = 720, which would imply that 7, 8 or 9 would be one of the digits of the solution, which as stated above is not possible.

Therefore, all digits of the number are in the range 0-5. Given that the sum of three factorials between 0 and 5 cannot exceed 360, we can exclude 4 and 5 for the first digit. Given that, the greatest value obtainable from the sum of the factorials of the digits would be 5! + 5! + 3! = 246, so 3 is also excluded. The first digit must then be 1 or 2 (can't be zero or we would have a 2 digit number.) We can also see that at least one of the other two digits must be 5 since if this is not true, the greatest obtainable value would be 4! + 4! +2! = 54, which is not a three digit number. We can then limit the first digit to 1 because 5! + 5! + 2! = 242 is the only way to get a value with a first digit of 2 given the constraints already determined. Obviously, this is not the solution, so the first digit must be 1.

Now, we know that the first digit must be 1 and that one of the other digits must be 5. The only odd factorials are 1! and 0!. We know that we have 1! in our sum. If either second or third digits are 0 or 1, the final value will be even. Otherwise the final value will be odd. If the second digit is 0 or 1, then the third digit must be 5 and the number is odd. This is impossible, however, since as discussed above, the final value would have to be even. Therefore, 0 or 1 cannot be the second digit. The third digit cannot be 1 either, since that would make the number odd, whereas the discussion above shows that the number must be even. Therefore, the only other option is that the third digit must be 0 or neither of the last two digits can be 0 or 1. If the third digit is 0, then we would have 1! + 5! + 0! = 122, which is obviously not the solution. Thus, neither of the last two digits are 0 or 1 so the solution must be an odd number. That leaves 3 or 5 as candidates for the last digit. 3 implies that the solution is 153. 1! + 5! + 3! = 127, so that is not right. Thus the last digit must be 5.

That leaves the middle digit. Here is where I ran into an equation that I could solve easily by inspection, but could not systematically solve. In this case, we would have
100 + 10x + 5 = 1! + x! + 5! , which reduces to
10x + 105 = 121 + x! or 10x - x! = 16. I easily recognized that for x=4 we get 4*10 - 24 = 16, so that is the solution. Does anyone have a better method for attacking equations such as 10x - x! = 16?

Just checking the reasoning 1! + 4! + 5! = 1 + 24 + 120 = 145, so 145 is indeed the solution to the problem.