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 $$

  • 1
    $\begingroup$ 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$ $\endgroup$ – Kal S. Feb 12 '17 at 13:04
  • $\begingroup$ @Test123 Is it possible to explain more, thanks. $\endgroup$ – Amin235 Feb 12 '17 at 13:06
  • 1
    $\begingroup$ Also $1 \times 1111\dots 11 =1111\dots11$ trivially! $\endgroup$ – Kal S. Feb 12 '17 at 13:06
  • $\begingroup$ @Test123 you right. I edit question and add your comment. thanks again. $\endgroup$ – Amin235 Feb 12 '17 at 13:07
  • 1
    $\begingroup$ See en.wikipedia.org/wiki/Cyclic_number and oeis.org/A180340 $\endgroup$ – 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}.$$

  • 1
    $\begingroup$ It is perfect solution. Thanks professor Daniel Fischer. $\endgroup$ – 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.

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

A solution to equation (1):


  • $\begingroup$ Is it possible to ask you to say with which software you find this number? Thanks. $\endgroup$ – Amin235 Feb 12 '17 at 13:54
  • $\begingroup$ 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. $\endgroup$ – Mathelogician Feb 12 '17 at 14:01
  • $\begingroup$ Your welcome, Thanks for your nice solution. $\endgroup$ – Amin235 Feb 12 '17 at 14:04
  • 1
    $\begingroup$ 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. $\endgroup$ – David K Feb 12 '17 at 14:32
  • $\begingroup$ @David K thanks for your comment, I edited it. $\endgroup$ – Mathelogician Feb 12 '17 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.