Prove that there exist a pal number with n digits n>1. We call a number pal if it doesn't have a non zero digit and the sum of the squares of the digits is a perfect square.For example 122 and 34 are pal but 302 and 12 are not pal.Prove that there exist a pal number with n digits n>1.
Also this is same as proving that sum of n squares(some can be same also )is a perfect square.
I think we can use induction here.But i don't Know to which topic does this question belong.nor do I have any idea to start this.!!
 A: The basic approach is to start with all $1$'s, with sum $n$ and change some digits to get up to a square.  Find $s =\lfloor \sqrt n \rfloor$.  We want to show that we can get to $(s+1)^2$  or $(s+2)^2$ assuming $n$ is large enough, then handle the small cases individually.  We have $(s+1)^2-n \le 2s$, so changing digits from $1$ to $2$ will get us enough, gaining $3$ each time.  We can gain $3$ by changing a $1$ to a $2$ or $8$ by changing a $1$ to a $3$, so if we have at least five $1$'s we can add any number required above $15$.  If $(s+1)^2-n$ is one of the numbers we cannot make, $1,2,4,5,7,10,13$ we need to go to $(s+2)^2$.  As long as $s$ is at least $5$, $(s+2)^2-n \ge 14$ and we are safe.  We therefore need to display solutions up to $n=24$  After $10$ I will not list all the $1$'s$$\begin {array} {r | l} \text n & \text {pal}\\1&1\\2&34\\3&221\\4&1111\\5&32222\\6&211111\\7&2222221\\8&32221111\\9&331111111\\10&2211111111\\11&322\\12&333\\13&322222\\14&3322\\15&2222222\\16&222\\17&332\\18&222222\\19&22\\20&33\\21&322\\22&2\\23&3222222\\24&2222 \end {array}$$
