Reversed Differences

  abc
- cba
-----
 (a,b,c in some order)
In the above difference equation, a, b, and c are three distinct digits. When the three digit number cba is subtracted from the three digit number abc, another three digit number results, composed of the digits a, b, and c in some order. Find the corresponding digits.

Repeat the problem for N digits (4<=N<=10). That is, subtract an N-digit number from its reverse to result in another N-digit number, such that each of the three consist of the same N distinct digits. Try to find the answer with the largest difference.

Source: Original extension of a problem from The Little Giant Encyclopedia of Puzzles.


Solutions were received from Al Zimmermann, Denis Borris, Leendert Biemans, Philippe Fondanaiche, Sudipta Das, Tuba Cekinirer, and Martin Ostrovsky.

Most solvers used a computer program, but there were some good insights for logical approaches. Here are some samples of the solutions received.

Here is my own quick solution for N=3:

The middle number of the answer must be either 0 or 9.
Since a > c, the middle number must be 9.
Since c < a, either b or a is 9.

If b is 9, then the first number of the answer has to be c and the last a.
Since the center column requires a borrow, 2*c = a-1, AND 2*a = c+10.
a has to be odd and < 9, but no solutions result in a valid c.

So a is 9.  Again 2*c = a-1, so c=4.  And the ones column shows b=5.
Al Zimmermann lists the solutions:
954 - 459 = 495
7641 - 1467 = 6174
96732 - 23769 = 72963
927801 - 108729 = 819072
9872541 - 1452789 = 8419752
98472501 - 10527489 = 87945012
987654321 - 123456789 = 864197532
9847623501 - 1053267489 = 8794356012
9846732501 - 1052376489 = 8794356012 (tie for maximum difference)
Denis Borris shows how many answers there were and the lowest and highest values used in the differences:
 N     CASES        LOW        HIGH
 3         1         954         954
 4         4        2961        9108
 5         8       58923       96732
 6        56      279351      981207
 7       178     2904561     9872541
 8       645    23769801    98601372
 9      2204   302548671   987654321
10      9568  2348765901  9875316042
Philippe Fondanaiche had some excellent insights for limiting the solutions:
N=3 digits
 Let A=abc and B=cba with a>c
 D = A - B is of the form 99*(a-c)
 One solution a - c = 5 ==> A = 954, B = 459, D = 495

N=4 digits
 A=abcd and B=dcba with a>d
 D = A - B is of the form 9*[111*(a-d) + 10*(b-c)]

N=5 digits
 D is of the form 99*[101*(a-e) + 10*(b-d)]

N=6 digits
 D is of the form 9*[1111*(a-f) + 1110*(b-e) +100*(c-d)]

N=7-10 digits
 Same approach as above.
Since they're short lists, here are the complete answers for N=4 and N=5, from Al Zimmermann:
N=4 4 solutions
    9108 - 8019 = 1089
    2961 - 1692 = 1269
    7641 - 1467 = 6174
    5823 - 3285 = 2538

N=5 8 solutions
    60273 - 37206 = 23067
    60732 - 23706 = 37026
    70254 - 45207 = 25047
    89604 - 40698 = 48906
    76941 - 14967 = 61974
    58923 - 32985 = 25938
    69723 - 32796 = 36927
    96732 - 23769 = 72963

Update 11/16/00. Claudio Baiocchi had some additional notes about different bases:
Let us denote by "uvw" the result:
abc-cba=uvw
where u,v,w are the digits a,b,c, in a suitable order. Of course the
problem has a meaning not only in basis 10, but with respect to any
basis B>2; let us consider such a generalization.

RESULTS

If B=10 the unique solution is given by a=9, b=5, c=4.

More generally, let Q be any nonnegative integer; when B=6Q+4 or B=6Q+6
there is a unique solution given by a=B-1, b=B/2, c=B/2-1;

the same triple also solves the problem when B=6Q+2 (with Q>0), but in
such a case a second solution exists: a=(2B-1)/3,b=B-1,c=(B-2)/3.

The last triple also works when B has the form B=6Q+5, case where again
the solution is unique;

in the remaining cases (B=6Q+1, and B=6Q+3) the problem has no
solutions.

PROOFS

No matter which is B one has:
1) a>c;
2) v=B-1;
3) uvw=(B*B-1)*(a-c); in particular u+v+w=0 mod B-1; say (because of
point 2, and u,w being digits in basis B) u+w=B-1. Now uvw=(B*B-1)*(a-c)
becomes u=a-c+1.


The maximum between a,b,c (which coincides with the maximum between
u,v,w) is of course the value of v, say B-1. We can then conclude with a
simple distinction of cases:

if a=B-1 then the known relations imply that the basis B must be even;
and this forces b=B/2, c=B/2-1;

if a=max[u,w] then the known relations imply that the basis B must be of
the form 3X+2; and this forces a=2X+1, b=3X+1, c=X.

Mail to Ken