0
$\begingroup$

Suppose $N$ is an $n$-digit positive integer such that

$\bullet$ all the $n$-digits are distinct; and

$\bullet$ the sum of any three consecutive digits is divisible by $5$.

Prove that $n$ is at most $6$. Further, show that starting with any digit one can find a six-digit number with these properties.

It is my question .Let the first digit be '$a$' and the second be '$b$' then the third become '$5n-(a+b)$. Then I found the fourth digit is $a$ , which is not possible.I can't found any way. Somebody please help me.

  • 0
    I edited, but is that what you meant?2017-02-25
  • 0
    Well, $1046$ is a four digit example...$10465$ is a five digit example...2017-02-25
  • 0
    @S.C.B. No you edit is useless,I don't mean it!!2017-02-25
  • 0
    @SufaidSaleel What do you mean? You really meant $n$ is at most $6$? But $6$ is not an integer that satisfies the property.....2017-02-25
  • 0
    @S.C.B. I said that N is the integer and n is the number of digits of N2017-02-25
  • 0
    I thought I understood the question, but maybe I don't. Are my two examples valid? If I understood you, you were saying that there weren't any four digit examples.2017-02-25
  • 0
    @lulu He said that $n$ is at most $6$, which implies that there exists $3$ or $4$ digit examples.2017-02-25
  • 0
    @S.C.B. Ok, but in the commentary he appears to assert that he can prove that there are no four digit examples. Well, probably I am just missing the point. No matter.2017-02-25
  • 0
    @lulu yeah,there are many 4 or 5 digit numbers but we have to prove that n is less than 6.2017-02-25

1 Answers 1

2

For any four consecutive digits, $\ldots abcd\ldots$ both $a+b+c$ and $b+c+d$ are multiples of $5$. It follows that $a\equiv d\pmod 5$. If $n>6$, consider seven conseutive digits: $\ldots abcdefg\ldots$. As above, we ave $a\equiv d\equiv g\pmod 5$, but for each remainder $\bmod 5$, there are only two candidate digits.

Starting from almost any three-digit number with distinct digits an digit sum divisible by $5$, we can use the above restrictions to extend it to a four, five, and six digit example. For example, from $460$ we get to $5460$, then to $15460$ and to $915460$. Only with a "bad start" such as $163$ with two digits differing by $5$, we get to $8163$ and are stuck (or with $136$, we are stuck immediately).