An integer n, such as 1128, is called "sorted" if its digits are in sorted order. Find the largest integer n such that both n and n^{2} are sorted.
(In reply to
more generally by Charlie)
There seem to be three infinite categories that satisfy the criterion:
333...333666...6667 where there are zero or more 3's, zero or more 6's and a 7.
333...3334 or 333...3335 where there are zero or more 3's.
1666...6667 where there are zero or more 6's.
The only fitting numbers that don't fit these categories seem to be:
n n^2
116 13456
117 13689
12 144
13 169
15 225
16 256
The largest such sporadic n would then be 117.

Posted by Charlie
on 20130728 09:34:33 