Applying the steps below, you will generate a number, on the condition that every digit of a number produced in each step is different from its other digits.
- Write down a number with one, two or three digits.
- Delete at most three consecutive digits and in the places of the deleted digits place the square of the number formed by these digits.
- For the number you get, repeat steps two and three. If you cannot get a number that satisfies the conditions, stop.
What is the largest number that can be generated through this mechanism?
Example: 307, 3(07), 349, 3(4)9, 3169, ...
Source: Puzzleup 2010