# Adding capicúas Juan wanted to add all the four-figure capicúa numbers but forgot to add one of them.

What number did you forget if the sum obtained was 490776?

#### Solution

We will try to find a shortcut to add all the capicúas that Juan should have added and then we will subtract the amount he has obtained. This will determine which one has stopped adding.

As we should write one over the other all four-figure capicúas, the first thing we should consider is a system by which we make sure we have them all and then count how many figures of each class we have used.

The first and the last number of each capicúa (that of the units and that of thousands units) must be equal and cannot be zero, since the number would be considered to have only three figures. So for the first figure we have nine possibilities. The second and third, which are also equal, can be worth any number, including zero, so we have ten possibilities.

If you look, then, when you put them in a column (which will be very high), each of the nine figures of the units will appear repeated ten times (because, if we set one of them, we can only write ten different capicúas), so the sum of that column will be (1 + 2 +… + 9) * 10 = 10 * (1 + 9) * 9/2 = 450. I place a 0 in the units of the sum, and I take 45.

In the tens column, however, ten different figures will appear, but repeated each one nine times. The sum will be 9 * (0 + 1 +… + 9) = 9 * (9 + 0) * 10/2 = 405. To this figure we must add the 45 that we take, which gives us a total of 450. again, we place a zero and we get 45.

In the hundreds column, the sum will be exactly the same as that of the tens, which for that they are capicúas, and will give again 405. As we took 45, it returns to give 450, again another 0 and we take 45.

In the last column, that of the thousand units, the sum is identical to that of the units, 450. If we add the 45 thousand units left over from the hundreds, we have 495, which are the definitive number of units of thousand we have.

In total, the sum should give 495000. As Juan had calculated 490776, we see that the difference is exactly 4224, how could it be otherwise, is capicúa and is the one that was missing.