# Is there a number such that the sum of its digits is $10$ and the sum of the digits of the number squared is $100$?

Let $s: \mathbb{Z}^+ \to \mathbb{Z}^+$ be the function that sends a positive integer to the sum of its digits. Is there a number $n$ such that $s(n)=10$ and $s(n^2)=100$? What I've tried so far is to write $n = 10^ma_m + ... + 10^0a_0$. I know that $\displaystyle\sum_{i=0}^m a_i = 10$ and that $\displaystyle(10^ma_m + ... + 10^0a_0)^2 = \sum_{i=0}^n 10^{2i}a_i^2 + 2\sum_{i<j}10^{i+j}a_ia_j$ but I don't really know how to deal with the powers of 10 to figure out if such number exists or not.

By computer search: $n=11111111101$ will work (not sure it is minimal).

Note: $n^2=123456789898765432201$.

• you coded the problem? – john doe Sep 18 '17 at 19:31
• @johndoe Not really. From experience with similar problems I expected there would be an answer with a lot of $1's$ so I just searched those. – lulu Sep 18 '17 at 19:32

$10111111111^2=102234567898987654321$ works, also.

$1111111111^2=1234567900987654321$ fails because of carries. Otherwise, the convolution of the digits would give that the sum of the digits of any $n^2$ would be the square of the sum of the digits of $n$. We just have to use small enough digits, and make some space so that carries do not come into play.

• Interestingly, it's just the mirror image! – john doe Sep 18 '17 at 19:39
• @johndoe: I think we can insert a $0$ anywhere within $1111111111$ to prevent the carries and get a solution. – robjohn Sep 18 '17 at 19:42
• @robjohn Nearly. There is a carry if the zero is in the middle. – Joffan Sep 18 '17 at 19:56
• @robjohn: Not in base six. Using that base for all numerals that follow, $1011111^2$ has the proper digital sum of $100$ (thirty-six base ten), similarly for $1101111^2, 1111011^2, 1111101^2$; but $1110111^2$ gives a digit sum of $51$ (thirty-one base ten). – Oscar Lanzi Sep 18 '17 at 19:59
• So it seems that a $0$ in the middle fouls things up in the even bases. I'll check this when I get back and add something to my answer. – robjohn Sep 18 '17 at 20:27

Just for fun, $200002002000202$ also works. The square is $40000800804088804808808040804$.