Find all polynomials $P$ with integer coefficients such that $$s(x)=s(y) \implies s(|P(x)|)=s(|P(y)|).$$for all $x,y\in \mathbb{N}$. Note: $s(x)$ denotes the sum of digits of $x$. Proposed by Şevket Onur YILMAZ
Problem
Source: Turkey Olympic Revenge 2023 P3
Tags: number theory, olympic revenge, Polynomials, sum of digits
08.03.2023 20:01
Bumping this masterpiece
08.03.2023 23:09
If $P(x)$ is constant then it is trivially true. Assume that it is not constant polynomial then our answer is $P(x)=\pm(10^kx +c)$ where $c$ is a non negative integer with at most $k$ digits i.e. $0\leq c 10^k$. So let us prove that. Let $P(x)=a_nx^n+...+a_1x+a_0$, where $a_0,a_1,...,a_n\in \mathbb{Z}$, without loss of generality we can assume $a_n>0$. Firstly let us show that $a_k\geq 0$ for all $k=0,1,...,n$. Let us assume that $a_k<0$ for some $k$. Let $k$ be the biggest of them thus $a_{k+1}>0$. We have $s(|P(10^m)|)=s(|P(1)|)$ for all $m\geq 0$. Then we have $$P(10^m)=a_n10^{mn}+...+a_1 10^m +a_0$$Now let us choose $m$ very big that none of the $a_k$ has $m$ digits. Then since $a_k<0$, for large enough $m$ we have $a_k 10^{km}+...+a_1 10^m+a_0<0$ and it does have $km+b_k$ digits where $b_k$ is the number of digits of $a_k$. Then $a_n10^{mn}+...+a_{k+1}10^{km+m}+a_k 10^{km}+...+a_1 10^m +a_0$ is a number with at least $km+m-km-b_k-1$ digit 9 in it and since $b_k$ is bounded if we choose $m$ large enough $P(10^m)$ has arbitrarily many digit 9 in it thus sum of its digits can be made large enough so it can not be bounded by $s(|P(1)|)$ so we get the desired contradiction. So we have shown that $a_k\geq 0$ for all $k$. Now let us show that degree of the polynomial must be $1$. Now for any integer $x$ we have $s(|P(x)|)=s(|P(10^mx)|)$ and we have $$P(10^nx)=a_n 10^{mn}x^n+...+10^mx a_1+a_0$$Now we can see that $a_{k+1}10^{m(k+1)}x^{k+1}$ has at least $mk+m$ zeros at the end. So let us try to choose that $a_k 10^{mk}x^k$ has fewer or equal digits then $mk+m$. So if we can choose $a_k x^k < 10^m$ then we are done. So if we choose $m$ large enough that we have $a_k x^k < 10^m$ for all $k=0,1,...,n$ then we have a very good picture about how our polynomials digits appear. When we choose $m$ very large our polynomial will appear as (from right to left) $a_0$ then many zeros then $a_1 x$ then many zeros, then $a_2x^2$ then many zeros and so on. Thus for any some positive integer $x$ and for large enough $m$ (depends on $x$) we have $P(10^mx)>0$ and ultimately $$s(P(10^mx))=s(a_n x^n)+...+s(a_1x)+s(a_0)$$And we also have for $x>0$, $P(x)>0$ thus we have $$s(a_nx^n+...+a_1x+a_0)=s(P(x))=s(P(10^mx))=s(a_n x^n)+...+s(a_1x)+s(a_0)$$So we have $$s(a_nx^n+...+a_1x+a_0)=s(a_n x^n)+...+s(a_1x)+s(a_0)$$for every $x>0$. In order to conclude our proof first we will put $x=9$ then we get $$s(a_n9^n+...+a_19+a_0)=s(9^n a_n )+...+s(9a_1)+s(a_0)$$Now we will put $x= 10^{m_1}+ 10^{m_2}+...+10^{m_9}$ where $m_1<m_2<...<m_9$. In our choice of $m_i$ we will try to make $m_{i+1}$ to be very very large in comparison to $m_i$ for the reasons that I will explain later. Now we will show that, for a proper choice of $m_i$ values we have $s(a_k x^k)>s(a_k9^k)$ for all $k>1$. And this will contradict with the fact that $s(x)=9$ therefore $s(P(x))=s(P(9))$ because we have $$s(P(x))=s(a_nx^n)+...+s(a_1x)+s(a_0)$$$$s(P(9))=s(9^n a_n)+...+s(9a_1)+s(a_0)$$Now let us deal the killing blow. We have $$a_k x^k =\sum_{i_1+...+i_9=k} a_k \frac{k!}{i_1!...i_9!} 10^{i_1m_1+...+i_9m_9} $$So this is the sum of $a_k \frac{k!}{i_1!...i_9!}$ with $i_1m_1+...+i_9m_9$ zero behind. Now we choose $m_1<<m_2<<...<<m_9$ so that for $i_1+...i_9=j_1+...+j_9=k$ with $i_s,j_s\geq 0$ for $s=1,2,...,9$. Then if $j_9<i_9$ we have $j_1m_1+...+j_9m_9>i_1m_1+...+i_9m_9$, then if $j_9=i_9$ but $j_8>i_8$ again we have the inequality and so on. And we also have that if $j_1m_1+...+j_9m_9>i_1m_1+...+i_9m_9$, we have $(j_1m_1+...+j_9m_9)-(i_1m_1+...+i_9m_9)$ is so big that none of the $a_k \frac{k!}{i_1!...i_9!}$ has that much digit. Then again we can see that $a_kx^k$ is a sum of all $a_k \frac{k!}{i_1!...i_9!}$ with many many zeros between. Then we have $$s(a_k x^k) =\sum_{i_1+...+i_9=k} s(a_k \frac{k!}{i_1!...i_9!} 10^{i_1m_1+...+i_9m_9}) = \sum_{i_1+...+i_9=k} s(a_k \frac{k!}{i_1!...i_9!}) $$Now we want to show that $$\sum_{i_1+...+i_9=k} s(a_k \frac{k!}{i_1!...i_9!})> s(a_k9^k) =s(a_k (1+1+...+1)^k) = s \Big( \sum_{i_1+...+i_9=k} a_k \frac{k!}{i_1!...i_9!} \Big) $$Now we want to show that sum of digits of many numbers is greater than the sum of digits of the sum of all that numbers. In general we know that $s(a+b)\leq s(a)+s(b)$ and even one of the digit sums of $a+b$ exceeds 9 we broke the equality. Let $a_k=10^{b_k}c_k$ where $10\nmid c_k$. Then just focus on the $9$ numbers, we have $i_1=k$, $i_2,...,i_9=0$ then we have $a_k \frac{k!}{i_1!...i_9!}=a_k$, similarly for $i_2=k$ and $i_1,i_3,...,i_9=0$ and so on. Then we have 9 $s(a_k)$ in our big summation $\sum_{i_1+...+i_9=k} s(a_k \frac{k!}{i_1!...i_9!})$. Now let us look at the last digit of $a_k$, clearly it must be 1 because otherwise when we add $9$ of them we exceed 10 and we broke the equality. Now even if the last digit of $a_k$ is 1, then we are at the border with 9 so all the last digits of $a_k \frac{k!}{i_1!...i_9!}$ must be 0 when none of the $i_s=k$. But then we must have $10|\frac{k!}{i_1!...i_9!}$ for all of them. Now we can easily show that this is not possible for all $i_1,i_2,...,i_9<k$ values when $k>1$. Now let us fix $i_3,i_4,...,i_9=0$, then we have $\frac{k!}{i_1!...i_9!}={k\choose i_1}$, now from Lucas theorem if $k$ is not a power of 2 we can find such $0<i_1<k$ with ${k\choose i_1}$ odd so it can not be divisible to 10. (In the representation of $k$ in 2-base make first digit 0 and choose remaining digits the same as $k$ i.e. put $i_1=k-2^l$ where $2^l<k<2^{l+1}$) Then similarly from Lucas theorem if $k$ is not a power of 5 we can find such $0<i_1<k$ with ${k\choose i_1}$ odd so it can not be divisible to 10. (In the representation of $k$ in 5-base make first digit 1 less and choose remaining digits the same as $k$ i.e. put $i_1=k-5^l$ where $5^l<k<5^{l+1}$), then we can see that $k$ must be a power of both 2 and 5 therefore $k=1$ must hold. Then we are done showing that if the degree of polynomial is greater then 1 the equation given in the problem can not hold. Now we have two things to show. We have $P(x)=ax+b$ then we need to show that $a=10^k$ and $b<10^k$. If $a=10^k$ and if $b\geq 10^k$ then choose $x=9 \times 10^m$ with $ax$ has same digits with $b$ and choose $x=9 \times 10^m$ with $m$ very large that $b$ has less than $m$ digits so equation can not hold for that two $x$ values. Finally if $a\neq 10^k$ for some $k\geq 0$, then put $x=c 10^k+d10^m$ where $c,d<10$ and choose $k,m$ such that first rightmost nonzero digit of $ac10^k$ and the left most nonzero digit of $ad10^m$ are at the same digit. Then by choosing $c,d$ as $3,4,5$ we can make the rightmost digit of $ac10^k$ and leftmost digit of $ad10^m$ greater or equal than 5 so when we add those two numbers together that digits passes 10 and in comparison put $x=c 10^{k+1}+d10^m$ then there is no exceed of 10 because now we shifted the bigger number to left by one digit to remove collision then those two $x$ values has same sum of digits but $P(x)$ do not therefore $a=10^k$ must hold and we are done.
10.03.2023 23:16