I am currently doing some preparatory maths for which I have an oral examination at the end of August, and am currently completely stuck trying understand how to solve a problem.

The problem is as follows:

Two three digit numbers, $\overline {abc}$ and $\overline {def}$, are such that $\overline {abc}-\overline {def}$ is divisible by $7$. Show that the six digit number $\overline{abcdef}$ is also divisible by $7$.

I have run through most all divisibility rules for dividing by $7$ I have come across, apart from brute-forcing, but I cannot grasp how to solve this problem. Any ideas or help for how to crack this nut would be very helpful and appreciated.

  • 7
    $\begingroup$ Hint: $7\,|\,1001$ $\endgroup$
    – Berci
    Jul 17, 2020 at 8:59
  • 7
    $\begingroup$ $abcdef=1000(abc)+def=1001(abc)+(def-abc)$ $\endgroup$
    – A. Goodier
    Jul 17, 2020 at 9:01
  • $\begingroup$ $xyz$ is divisible by $7$ iff $|xy - 2z|$ is divisible by $7$. $\endgroup$ Mar 13, 2021 at 0:33

2 Answers 2


I think that the comments suffice to solve this particular exercise, but more generally, any time you want to proof divisibility criteria for integers, the solution usually lies in manipulating the decimal expansion of numbers, as in (using your notation): $$\overline{abcdef}= 10^5 a+10^4 b+10^3 c +10^2 d+10^1 e + 10^0 f$$

As you can see from the comments, you can also manipulate "bigger chunks" of the expansion, as in $$\overline{abcdef}=10^4\cdot\overline{ab}+10^2\cdot\overline{cd}+10^0\cdot\overline{ef}$$

In this case, the solution comes from simply noticing that $\overline{abcdef}=10^3\cdot\overline{abc}+10^0\cdot\overline{def}$, thus giving:

$$ \overline{abcdef}=1000\overline{abc}+\overline{def}=1001\overline{abc}+(\overline{def}-\overline{abc}) $$

Since $1001$ is divisible by $7$, you get the characterization you were looking for: $\overline{abcdef}\equiv\overline{def}-\overline{abc}\mod 7$, or in other words, $\overline{abcdef}$ is divisible by $7$ if and only if $\overline{def}-\overline{abc}$ is (sign doesn't matter in this case).


Use congruences: $1000\equiv -1\mod 7$, hence the number $$[abcdef]_{10}=1000\cdot [abc]_{10}+[def]_{10}\equiv [def]_{10}-[abc]_{10}\mod7.$$

Note: This is the analog of the criterion for divisibility by $11$ in base $10$. Virtually, the numbers are written here in base $1000$.

For the exact same reason, you obtain criteria for divisibility by $13$ and by $37$.

  • 1
    $\begingroup$ Yes (almost). I messed up on typing. Thanks for pointing it! $\endgroup$
    – Bernard
    Jul 17, 2020 at 9:44

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.