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.

]]>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 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.

]]>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. ]]>

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.

]]>***

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.

]]>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

]]>“Side note: since A = 2, and ABCD < 2,500, we also know that B 7 because A*4 must be 8…”

]]>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.

]]>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.

]]>Just a minor quibble. In the first line on the second problem, I was temporarily confused. Your notation has white’s second move as 2. Rxa4+. You really should have written this as 2. Rcxa4+ since the rook on the a file could take the a4 pawn and give check. Clearly that move doesn’t lead to stalemate since black would be able to capture that rook on a7.

Like I said, I minor thing, but I was a bit confused on first reading. Probably that’s on me, but adding the “c” to the notation would help.

]]>