Decompose sum into reversible pairs Is there any efficient way to find if a sum can be decomposed into reversible pairs?And if it does can we find these numbers?
For example 66 can be decomposed into 24+42 or 66666=12345+54321.
One solution could be brute force but is there any other solution?
Thanks.
You're going to have different techniques for different numbers of digits.

1 digit numbers
$n$ must be even, then there is only one sum: $\frac n2 + \frac n2$

2 digit numbers

For $10 \le n&lt;20$ and $n$ even, there is the simple sum: $\frac n2 + \frac n2$

For other $n$, consider the sum of a number $10a+b$ and its reverse $10b+a$.

The sum is $11a+11b = 11(a+b)$

So the only other 2 digit numbers are those that are multiples of 11. We can call these $n=11k$ for $k=1,2,3,4,5,6,7,8,9$. We can list the pairs of values $a,b$ that give $a+b=k$.

3 digit numbers

Consider first 3 digit numbers that have been created by adding together two 2 digit numbers. So $(10a+b)+(10b+a)=100x+10y+z=n$. Note that $n = 11(a+b)$: $n$ must be a multiple of $11$. 

It must be that $x=1$ and that $(a+b) \ge 10$. So $a+b=10+z$

Consider next 3 digit numbers that have been created by adding together two 3 digit numbers. So $(100a+10b+c)+(100c+10b+a)=100x+10y+z=n$.

To prevent a carry into the Thousands column, we need $a+c&lt;10$. This means there is likewise no carry from the Units column to the Tens column, so $2b=y$ or $2b=y+10$. In each case, we require $y$ to be even. We have to check if $x=z$ (which indicates that there was no carry from the Tens so $2b=y$) or if $x=z+1$ (in which case there was a carry from the Tens so $2b+10=y$.

Pseudocode algorithm for 1 to 3 digit numbers.

Let number under consideration be $n$

If number of digits = 1

If $n$ odd then there are no ways to achieve this.

If $n$ even then there is a single sum: $\frac n2 + \frac n2$

If number of digits = 2

If $n$ is a multiple of 11

Let $n=11p$

The sums are: $(10k  + p-k) + (10(p-k) +k)$ for $k = 0, 1, ..., \lfloor \frac p2 \rfloor $

If $10 \le n&lt;20$ and $n$ is even, then there is the sum: $\frac n2 + \frac n2$

Fotr other $n$ it is not possible to write them as a reversed pairs.

If number of digits = 3

Let $n=100x+10y+z$

If $x=1$ and $n$ is a multiple of 11, then sums are: $(10k  + z-k) + (10(z-k) +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $x=z$ and $y$ is even, then sums are: $(100k + 10 \frac y2 + z-k) + (100(z-k) +10 \frac y2 +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $x=z+1$ and $y$ is even, then sums are: $(100k + 10 \frac {y+10}2 + z-k) + (100(z-k) +10 \frac {y+10}2 +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

Else no sums are possible.

If number of digits = 4

Let $n=1000w+100x+10y+z$

If $w=1$ and $x=z$, then $y$ must be even (or no sums). The sums are: $\left (100(z-k) + (\frac y2) \times 10 + k \right)+\left (100k + (\frac y2) \times 10 + z-k \right)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $w=1$ and $x=z+1$, then $y$ must be odd (or no sums).

The sums are: $\left (100(z-k) + (\frac {y+10}2) \times 10 + k \right)+\left (100k + (\frac {y+10}2) \times 10 + z-k \right)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

There are other sums that give 4 digit numbers - just need more time to develop that. Is this helping you?
You're going to have different techniques for different numbers of digits.

1 digit numbers
$n$ must be even, then there is only one sum: $\frac n2 + \frac n2$

2 digit numbers

For $10 \le n&lt;20$ and $n$ even, there is the simple sum: $\frac n2 + \frac n2$

For other $n$, consider the sum of a number $10a+b$ and its reverse $10b+a$.

The sum is $11a+11b = 11(a+b)$

So the only other 2 digit numbers are those that are multiples of 11. We can call these $n=11k$ for $k=1,2,3,4,5,6,7,8,9$. We can list the pairs of values $a,b$ that give $a+b=k$.

3 digit numbers

Consider first 3 digit numbers that have been created by adding together two 2 digit numbers. So $(10a+b)+(10b+a)=100x+10y+z=n$. Note that $n = 11(a+b)$: $n$ must be a multiple of $11$. 

It must be that $x=1$ and that $(a+b) \ge 10$. So $a+b=10+z$

Consider next 3 digit numbers that have been created by adding together two 3 digit numbers. So $(100a+10b+c)+(100c+10b+a)=100x+10y+z=n$.

To prevent a carry into the Thousands column, we need $a+c&lt;10$. This means there is likewise no carry from the Units column to the Tens column, so $2b=y$ or $2b=y+10$. In each case, we require $y$ to be even. We have to check if $x=z$ (which indicates that there was no carry from the Tens so $2b=y$) or if $x=z+1$ (in which case there was a carry from the Tens so $2b+10=y$.

Pseudocode algorithm for 1 to 3 digit numbers.

Let number under consideration be $n$

If number of digits = 1

If $n$ odd then there are no ways to achieve this.

If $n$ even then there is a single sum: $\frac n2 + \frac n2$

If number of digits = 2

If $n$ is a multiple of 11

Let $n=11p$

The sums are: $(10k  + p-k) + (10(p-k) +k)$ for $k = 0, 1, ..., \lfloor \frac p2 \rfloor $

If $10 \le n&lt;20$ and $n$ is even, then there is the sum: $\frac n2 + \frac n2$

Fotr other $n$ it is not possible to write them as a reversed pairs.

If number of digits = 3

Let $n=100x+10y+z$

If $x=1$ and $n$ is a multiple of 11, then sums are: $(10k  + z-k) + (10(z-k) +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $x=z$ and $y$ is even, then sums are: $(100k + 10 \frac y2 + z-k) + (100(z-k) +10 \frac y2 +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $x=z+1$ and $y$ is even, then sums are: $(100k + 10 \frac {y+10}2 + z-k) + (100(z-k) +10 \frac {y+10}2 +k)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

Else no sums are possible.

If number of digits = 4

Let $n=1000w+100x+10y+z$

If $w=1$ and $x=z$, then $y$ must be even (or no sums). The sums are: $\left (100(z-k) + (\frac y2) \times 10 + k \right)+\left (100k + (\frac y2) \times 10 + z-k \right)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

If $w=1$ and $x=z+1$, then $y$ must be odd (or no sums).

The sums are: $\left (100(z-k) + (\frac {y+10}2) \times 10 + k \right)+\left (100k + (\frac {y+10}2) \times 10 + z-k \right)$ for $k = 0, 1, ..., \lfloor \frac z2 \rfloor $

There are other sums that give 4 digit numbers - just need more time to develop that. Is this helping you?