When a number is added to its reverse (digits in reverse order), sum it.
For example:
102 + 201 = 303
508 + 805 = 1313
246 + 642 = 888
Given all numbers between 0 and 10^9, discover the pattern to generate them without calculate all (only unique).
Solution idea
For 0 to 9, just calculate it all.
For remaining values, think as below. you don't need to build the table, but use the concept.
Setup a table for value of same number of digits (let number of digit be r) size: 9 column with 10^(r-1) row value distribution: Top left corner is the smallest of that digit part, plus one when moving down, plus 10^(r-1) when moving right
10 20 30 40 50 60 70 80 90
11 21 31 41 51 61 71 81 91
12 22 32 42 52 62 72 82 92
...
...
19 29 39 49 59 69 79 89 99
Looking at this table, you will observe the result of any value will be same as the result as the one on its top right position (upward by 1 and right by 1).
In this sense, you should be able to see for digit r table, the count can be calculated by looking up result of values on first column and last row and then for each result calculated times a correct counter (number of values in its diagonal in point 2, values between 1 to 9)
(result of 10) * 1
(result of 11) * 2
(result of 12) * 3
(result of 13) * 4
(result of 14) * 5
(result of 15) * 6
(result of 16) * 7
(result of 17) * 8
(result of 18) * 9
(result of 19) * 9
(result of 29) * 8
(result of 39) * 7
(result of 49) * 6
(result of 59) * 5
(result of 69) * 4
(result of 79) * 3
(result of 89) * 2
(result of 99) * 1
But I realized that numbers with three, four, and so on. It's using the same pattern at all. I'm still missing more things which I'm not able to see.
Have you looked at the problem algebraically?
$(a*10^2 + b*10 + c) + (c*10^2 + b*10 + a) = ???$
Then consider what conditions must be placed on a,b,c so that the sum is self-similar. On the flip side, what conditions must be true for a self-similar number to be a reversed sum? Can 101 be the result of a reversed sum? Why is it impossible?