# An Exploration of the "6174 Problem" and Some Generalizations

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

Given a four-digit number, rearrange the digits first in descending order and then in ascending order. Subtract the two numbers obtained to arrive at a new four-digit number. As an example, if the original number is 1025, the new number is 5210 - 0125 = 5085. When this procedure is iterated sufficiently many times, using any starting number that does not have all four digits equal, the result is the fixed point 6174. This Demonstration allows you to vary the number of digits and the base in which the number is represented. You can view the computations for a given starting number or plot the iterated values versus the original numbers for all numbers with a fixed number of digits.

Contributed by: Marc Brodie (Wheeling Jesuit University) (March 2011)

Inspired by: Robert Dumonceaux

Open content licensed under CC BY-NC-SA

## Snapshots

## Details

## Permanent Citation