I have a 4-digit positive integer that doesn't have a 0 in it. If I rearrange the digits of the number to make the smallest possible number, then this new number is 4338 less than the original number. Similarly, if I rearrange the digits to make the greatest possible number, then this new number is 3834 more than the original number.

What is my number?

The answer is 5917.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Let the unknown number be $N$ and the four digits be $a \le b \le c \le d$ . Then the smallest number is $\overline{abcd}$ and the greatest number is $\overline{dcba}$ .

$\begin{cases} N - \overline{abcd} = 4338 & ...(1) \\ \overline{dcba} - N = 3834 & ...(2) \end{cases}$

$\begin{aligned} (1)+(2): \overline{dcba} - \overline{abcd} & = 8172 \\ 999(d-a) + 90(c-b) & = 8172 & \small \color{#3D99F6} \text{Divide both sides by }9 \\ 111(d-a) + 10(c-b) & = 908 \end{aligned}$

A solution to the above equation is $d-a=8$ and $c-b=2$ . Then the only solutions for $d$ and $a$ are $d=9$ and $a=1$ . Let $N=\overline{uvwx}$ . Then, from $(1)$ :

$\begin{aligned} \overline{uvwx} - \overline{1bc9} & = 4338 \\ \implies u - 1 & = 5 & \implies u = 5 \\ \implies 10+x - 9 & = 8 & \implies x = 7 \end{aligned}$

Since $c-b=2$ , $\implies c=b+2$ $\implies u=b = 5$ and $x=c=7$ . From $\overline{5vw7} - \overline{1579} = 4338$ $\implies v = d = 9$ , $w=a=1$ and $N = \boxed{5917}$ .