A positive integer is brazilian if the first digit and the last digit are equal. For instance, $4$ and $4104$ are brazilians, but $10$ is not brazilian. A brazilian number is superbrazilian if it can be written as sum of two brazilian numbers. For instance, $101=99+2$ and $22=11+11$ are superbrazilians, but $561=484+77$ is not superbrazilian, because $561$ is not brazilian. How many $4$-digit numbers are superbrazilians?
Problem
Source: Brazil National Olympiad 2020
Tags: combinatorics
14.11.2021 15:55
Answer : 822 First claim that we have is that the is no brazilian or superbrazilian with the last digit as 0, because it has to start with 0 and that "breaks the total digits" The exist 9.10.10 = 900 brazilian numbers by the first claim, because there are 9 possibilities to the first digit , 10 for the second and third and only one for the last digit . We can find 800 superbrazilian numbers just by summing 1001 + ZXYZ as z being a number $\in$ [1,8] . Finding a number Z+1 XY Z+1. So, you just need to find the case where you get 1XY1 for X and Y being random digits. Puting 999 + 2 , 999 + 22 = 1001 and 1021 you get (2 cases) Putting 909 + 2X2, we get 11X1 numbers, as X can be 1 to 9 ( 9 cases) Putting 797 + 4X4, we get 12X1, with 10+x can be any number 0 to 9, ( 10 cases) Last but not least, 22 + 989 = 1011 ( 1 case ) 800 + 2 + 10 + 9 + 1 = 822 cases