Is the number 3776543210123456773, in base 8, divisible by 7?

I started by expanding the number:
3 * $8^0$ + 7 * $8^1$ + 7 * $8^2$ + ...
3 * $(7 + 1)^0$ + 7 * $(7 + 1)^1$ + 7 * $(7 + 1)^2$ + ...

Then, by using Newton's Binomial Theorem, I reasoned that for each binomial, only the first term wouldn't be divisible by 7 since it would be equal to 1. This led me to the conclusion that each digit of the initial number would be multiplied by one once. Therefore, if the sum of all digits was divisible by 7, the number would also be divisible by 7.

However, I converted this number to base 10 and the remainder of the division by 7 was equal to 2, instead of 0, which was the result I found using the reasoning above.

I can't seem to find where I made a mistake. :c


marked as duplicate by Bill Dubuque divisibility Jun 3 at 15:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ Any number in base $8$ is divisible by $7$ if and only if it's digit sum is divisible by $7$. $\endgroup$ – Peter Foreman May 4 at 22:11
  • $\begingroup$ Simple computer check: "yes." $\endgroup$ – David G. Stork May 4 at 22:12
  • $\begingroup$ My reasoning was correct, then? That would mean the mistake happened in the conversion of the number to base 10, right? $\endgroup$ – pug May 4 at 22:12
  • 2
    $\begingroup$ Your online converter is incorrect as the input number is odd whereas what you just wrote is even. $\endgroup$ – Peter Foreman May 4 at 22:21
  • 2
    $\begingroup$ The online calculator must be using double precision floating point for its storage format; unfortunately, the number is more detailed than that format can contain, so the conversion is incorrect. I wrote about that sort of problem in an answer to another question about numbers not going through software fully intact: math.stackexchange.com/a/2839637/167895 $\endgroup$ – Dan Uznanski May 4 at 22:28

Your reasoning is correct. But the sum of the digits of the digits of your number is $76$. And the remainder of the division of $76$ by $7$ is $6$, of course. So, the remainder of the division of your number by $7$ is $6$ too.

And, in base $10$, your number is $72\,011\,638\,983\,515\,643$, whose remainder, when divided by $7$, is $6$ too.


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