Maria's Puzzle Book Reloaded [Puzzle 26]

@Karifean

oh, I thought to count them for some reason. Good thing I didn’t tackle this puzzle, heh.

Anyway, the logic checks out, I must have made a mistake when calculating myself, as I’m 9000 something of your result, @midsummer. But, for the others, @King_Titanite_XV already lined out a way to systematically find all numbers that start with the same letter that they end on. What one can do now is proceed letter by letter. So for example for the letter N there’s all numbers that look like so: 19, 97, 9y7, 91z, 9xy7, 9x1z, 19xy7, 19x1z, 9xxy7, 9xx1z, 9xxxy7, 9xxx1z. x standing for any single digit, y standing for any single digit except 1 and z standing for any single digit except 2.

So let’s start with 9y7. There are basically 9 different numbers here, 907, 927, 937, 947, 957, 967, 977, 987, 997. So what one can do is calculate 907*9 and then add the loose change, so to speak, so 20+30+40+50+60+70+80+90=440. So that would be 8603, added together.

Now let’s look at one of the bigger ones, 9xy7 for example. Let’s ignore the y for now and treat that as a single digit for now. So we have to deal with that x now. this x can basically be 10 different digits, so we again multiplicate the base number, this time 9007, with ten and then add the loose change from the x on top of that. This loose change from any number of x-es can be done with the Gauß-formula, since we are basically adding consecutive numbers starting at 1. For those unfamiliar with that formula, it’s this here:
comic009
Since our x (or later, number of x-es) ends at the hundreds digit, we have to multiplicate the result with 100 before we add it. Now, with the y we deal similarly to how we dealt before, so we multiplicate our result we currently have with 9 and add 44 (adding 2 to 9) * 10 (since the y is at the tens digit) * 10 (since we have to add the second lose change 10 times because we multiplicated the base number with ten before doing anything else).

This is the basic principle that can be used for all numbers and I should have ended up with the same result as @midsummer there.

1 Like