LogicalAndReasoning TrialAndError
2013


Problem - 1852
Call a positive integer squarish if it contains the digits of the squares of its digits in order but not necessarily contiguous. For example, $14263$ contains $1^2 = 1$, $4^2 = 16$ and $2^2 = 4$. However, it is not squarish because it does not contain $3^2 = 9$, and $6^2 = 36$ is not in order. What is the smallest squarish number that includes at least one digit greater than $1$?

Answer     381649

The first few squares are $1$, $4$, $9$, $16$, $25$, $36$, $49$, $64$, $81$, $100$

Let’s start with $1^2 = 1$.

$12$ is next and $2^2 = 4 \implies 124$ is next and $4^2 = 16\implies 1246$ is next and $6^2 = 36\implies 12436$ is next.

We can switch this to $12346$ without violating the requirements. Now $3^2 = 9 \implies 123469$ is next and $9^2 = 81\implies 8123469$ isn’t next because $8^2 = 64$ and the $4$ is before the $6$.

Let’s move that. $8123649$. This works but can we make the value smaller by moving some of the numbers around? $2364981$: I just moved $81$ to the end. That’s good but can I move anything again? Yes, it won’t hurt if I switch the $9$ and $81$: $2364819$. Meanwhile, $13$ can be reduced in a similar way to $381649$.  $14$ can be reduced to $348169$. $15$ can be reduced to $2364819$. $16$ is can be reduced to $381649$. $17$ can be reduced to $8136479$.$18$ is next and leads to $381649$. $19$ leads to $381649$.  We notice that no matter what else we do this number is greater than $381649$. 

Hence, we conclude that the answer is $381649$.

report an error