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.

  1. Write down a number with one, two or three digits.
  2. Delete at most three consecutive digits and in the places of the deleted digits place the square of the number formed by these digits.
  3. 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

  • $\begingroup$ Could the tag "computer-puzzle" be appropriate or is this really doable with logical deduction? $\endgroup$ – A. P. Dec 17 '17 at 18:20
  • $\begingroup$ @A.P. well, you are free to find it by a computer, I am not sure whether if it is needed. not my original. $\endgroup$ – Oray Dec 17 '17 at 18:29

As this didn't had a no-computers tag. I used a computer program.

The answer is as follows:



Start with


Remove 2 digits

98 and 98^2= 9604

The Number becomes


Remove again 2 digits

96 and 96^2=9216

The Number becomes


Remove one digit

6 and 6^2=36

The Number becomes


The maximum number is


  • $\begingroup$ 987 already has a 9. So is squaring 98 to get 9604 valid? $\endgroup$ – prog_SAHIL Dec 17 '17 at 18:41
  • $\begingroup$ Look at the given example when you use the square of digits you replace them with the square $\endgroup$ – yass Dec 17 '17 at 18:45
  • $\begingroup$ I wrote a computer program instead. Manual calculation of this would have been impossible. $\endgroup$ – prog_SAHIL Dec 17 '17 at 18:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.