Let $p$ be a prime integer greater than $10^k$. Pete took some multiple of $p$ and inserted a $k-$digit integer $A$ between two of its neighbouring digits. The resulting integer C was again a multiple of $p$. Pete inserted a $k-$digit integer $B$ between two of neighbouring digits of $C$ belonging to the inserted integer $A$, and the result was again a multiple of $p$. Prove that the integer $B$ can be obtained from the integer $A$ by a permutation of its digits. (8 points) Ilya Bogdanov
Problem
Source: Tournament of Towns Spring 2016 Junior A-Level
Tags: number theory
24.02.2017 12:14
Can someone check my solution ? Let in the end we get number $\overline{D_1A_1BA_2D_2}$, where $C=\overline{D_1A_1A_2D_2},A=\overline{A_1A_2}$. And lenghts of $D_1,A_1,B,A_2,D_2$ are $l_5,l_4,l_3,l_2,l_1$ . $l_4+l_2=l_3=k$ $p|\overline{D_1D_2}=10^{l_1}D_1+D_2$ $p|\overline{D_1A_1A_2D_2}=10^{l_1+l_2+l_4}D_1+10^{l_1+l_2}A_1+10^{l_1}A_2+D_2$ $p|\overline{D_1A_1BA_2D_2}=10^{l_1+l_2+l_3+l_4}D_1+10^{l_1+l_2+l_3}A_1+10^{l_1+l_2}B+10^{l_1}A_2+D_2$ From first two lines we get $p|\overline{D_1A_1A_2D_2}-\overline{D_1D_2}=D_1 10^{l_1}(10^{l_2+l_4}-1)+10^{l_1+l_2}A_1+10^{l_1}A_2 =10^{l_1} (D_1(10^{k}-1)+10^{l_2}A_1+A_2)$ $p|(D_1(10^{k}-1)+10^{l_2}A_1+A_2)$ From 2 and 3 line we get $p|\overline{D_1A_1BA_2D_2}-\overline{D_1A_1A_2D_2}=D_1 10^{l_1+l_2+l_4} (10^{l_3}-1)+A_1 10^{l_1+l_2}(10^{l_3}-1)+B10^{l_1+l_2}=10^{l_1+l_2}(D_110^{l_4}(10^k-1)+A_1(10^k-1)+B)$ $p|D_110^{l_4}(10^k-1)+A_1(10^k-1)+B$ $p|D_110^{l_4}(10^k-1)+A_1(10^k-1)+B-10^{l_4}(D_1(10^{k}-1)+10^{l_2}A_1+A_2)=A_1(10^k-1)+B-10^kA_1-10^{l_4}A_2=B-10^{l_4}A_2-A_1$ $B-10^{l_4}A_2-A_1<10^k<p$ and $B-10^{l_4}A_2-A_1\geq 10^{k-1}-10^{l_4}(10^{l_2}-1)-(10^{l_4}-1)=10^{k-1}-10^k+1>-10^k>-p$ So $B-10^{l_4}A_2-A_1=0$ But it means, that $B=\overline{A_2A_1}$