# Searching for numbers like $4\times (102564)=410256$

Consider the following relation $$a_{n+1}\times (a_1\,a_2\cdots a_n\,a_{n+1})=a_{n+1}\,a_1\,a_2\cdots a_n \tag{1}$$ in which $(a_1\,a_2\cdots a_n\,a_{n+1})$ and $(a_{n+1}\,a_1\,a_2\cdots a_n)$ are two numbers with $(n+1)$ digits and $a_i$, $1\leq i \leq n+1$ are integer numbers such that $0\leq a_i \leq 9$, $1\leq i \leq n+1$.

One solution for relation $(1)$ are $a_i=1$, $1\leq i \leq n+1$ that is called trivial solution. By full search, just I found one non-trivial solution for relation $(1)$, as follows $$4\times (102564)=410256$$

My question: Is there an analytic method to show that there is only one non-trivial solution for relation $(1)$ or if it has other solutions how to find these numbers except full search method.

I would appreciate any suggestions.

Edit(1): By @Test123 comment, we can put conditions like $a_{n+1}a_1<10$.

Relation $(1)$ can be expressed by $$(a_{n+1}\,a_n-a_{n+1})\,10^{n}+\sum_{i=2}^{n}\,(a_{n+1}\,a_{i-1}-a_i)\,10^{i-1}\,+\, a_{n+1}^2-a_1=0$$

• You could put conditions on the $a_k's$ since the number of digits is the same. e.g. $a_{n+1}a_1<10$ – Kal S. Feb 12 '17 at 13:04
• @Test123 Is it possible to explain more, thanks. – Amin235 Feb 12 '17 at 13:06
• Also $1 \times 1111\dots 11 =1111\dots11$ trivially! – Kal S. Feb 12 '17 at 13:06
• @Test123 you right. I edit question and add your comment. thanks again. – Amin235 Feb 12 '17 at 13:07
• – lab bhattacharjee Feb 12 '17 at 13:21

Let's more generally look at numbers such that

$$a_{n+1} a_1 a_2 \dotsc a_n = m\cdot a_1 a_2 \dotsc a_n a_{n+1}$$

for some $m > 1$. Writing $A = a_1 a_2 \dotsc a_n$, this becomes

$$10^n\cdot a_{n+1} + A = m\cdot (10A + a_{n+1}),$$

which we rearrange to

$$(10^n - m)a_{n+1} = (10m - 1)A.$$

We can now look at the possible multipliers $m$ in turn.

For $m = 2$, the factor $10m - 1$ on the right is prime, so we must have $10^n \equiv 2 \pmod{19}$, which holds if and only if $n \equiv 17 \pmod{18}$. This gives the solutions

$$A = \frac{10^{18k+17}-2}{19}\cdot a_{n+1}.$$

For $a_{n+1} = 1$ that produces $a_1 = 0$, which may be deemed invalid. For $2 \leqslant a_{n+1} \leqslant 9$, $A$ is a true $18k+17$-digit number, and for $a_{n+1} = 2$, it produces a number of the form you look for, with $m = a_{n+1}$.

For $m = 3$, we also have $10m-1$ prime, and we need $10^n \equiv 3 \pmod{29}$, which means $n \equiv 27 \pmod{28}$. We get the solutions

$$A = \frac{10^{28k+27}-3}{29}a_{n+1}$$

which for $a_{n+1} < 3$ again produce possibly invalid $a_1 = 0$, and for $a_{n+1} = 3$ gives a number of the desired form.

For $m = 4$, the factor $10m-1$ is not prime, $39 = 3\cdot 13$, but since $10^n - 4 \equiv 0 \pmod{3}$ for all $n$, we again must have $10^n \equiv 4 \pmod{39}$, which is equivalent to $n \equiv 5 \pmod{12}$. This gives the solutions

$$A = \frac{10^{12k+5}-4}{39}a_{n+1}.$$

Once again we get leading zeros for $a_{n+1} < m$, and for $a_{n+1}$ we get numbers of the desired form (your example for $k = 0$).

For $m = 5$, we have $10m-1 = 49 = 7^2$, and we get two families of solutions, one with $a_{n+1} = 7$ and $10^n \equiv 5 \pmod{7}$, which means $n \equiv 5 \pmod{6}$, and one with arbitrary $a_{n+1}$ and $10^n \equiv 5 \pmod{49}$, which means $n \equiv 41 \pmod{42}$. This gives

$$A = \frac{10^{6k+5}-5}{7},\; a_{n+1} = 7\quad\text{and}\quad A = \frac{10^{42k+41}-5}{49}a_{n+1}.$$

As usual, we have leading zeros for $a_{n+1} < 5$.

For $m = 6$, again $10m-1$ is prime, and we get

$$A = \frac{10^{58k+57}-6}{59}a_{n+1}.$$

For $m = 7$, we have $69 = 3\cdot 23$ and again $10^{n} - 7 \equiv 0 \pmod{3}$ for all $n$, which gives the solutions

$$A = \frac{10^{22k+21}-7}{69}a_{n+1},$$

with the usual caveat about leading zeros for $a_{n+1} < 7$.

For $m = 8$, the factor $10m-1$ is again prime, and we get the solutions

$$A = \frac{10^{13k+12}-8}{79}a_{n+1}.$$

For $m = 9$, the solutions are

$$A = \frac{10^{44k+43}-9}{89}a_{n+1}.$$

• It is perfect solution. Thanks professor Daniel Fischer. – Amin235 Feb 12 '17 at 14:16

Observe, that if you choose $a_{n+1}$ then the other coefficients are determint iteratively. To stay in your example: choose 4. Then 4×4 = 16, so your next digit has to be 6. 6×4 is 24, plus 1 from the tens in 16 is 25, so next digit is 5. And so on. Is this helping you? Otherwise I can formalize this idea, once I am in front of a computer.

• Is it true your method for @Mathelogician solution? – Amin235 Feb 12 '17 at 14:01
• yes. it is. 2×2=4, 2×4=8 and so on. – lalala Feb 12 '17 at 14:16
• Ok formalize your idea. – Amin235 Feb 12 '17 at 14:18
• do you currently understand the idea? Formal notation doesnt always make it more obvious. Earliest would be in 2 days. – lalala Feb 12 '17 at 14:25
• By your answer, the Maple procedure of these numbers is as shown. – Amin235 Feb 13 '17 at 9:38

A solution to equation (1):

$2(105263157894736842)=210526315789473684.$

• Is it possible to ask you to say with which software you find this number? Thanks. – Amin235 Feb 12 '17 at 13:54
• By my hands. Actually, there is not a necessity any software to compute this. If my math education were enough, i could explain it. Thank you for a question like this. – Mathelogician Feb 12 '17 at 14:01
• Your welcome, Thanks for your nice solution. – Amin235 Feb 12 '17 at 14:04
• You can also solve the equation by "concatenating" two or more copies of these numbers together: $2(105263157894736842105263157894736842)=210526315789473684210526315789473684.$ This gives an infinite set of solutions, but as Daniel Fischer showed, it is the complete solution set. – David K Feb 12 '17 at 14:32
• @David K thanks for your comment, I edited it. – Mathelogician Feb 12 '17 at 14:41