3

My question is slightly more complicated than what's implied on the title, so I will start with an example. Given any number $N$ on base $10$, we can easily determine whether or not $N$ is divisible by any $d\in[2,9]$, except for $d=7$:

  • $N$ is divisible by $2$ if $N\bmod10$ is divisible by $2$
  • $N$ is divisible by $3$ if $N$'s digit-sum is divisible by $3$
  • $N$ is divisible by $4$ if $N\bmod100$ is divisible by $4$
  • $N$ is divisible by $5$ if $N\bmod10$ is divisible by $5$
  • $N$ is divisible by $6$ if $N$ is divisible by $2$ and $3$
  • $N$ is divisible by $8$ if $N\bmod1000$ is divisible by $8$
  • $N$ is divisible by $9$ if $N$'s digit-sum is $9$

In the case of $d=7$, we pretty much have to perform a full division (at least for some values of $N$).

I believe that the general rule for base $B$ and $d\in[2,B-1]$ is the following:

[We can easily determine $d|N_B]\iff[\gcd(B,d)>1]\vee[gcd(B-1,d)>1]$

Is there an easy way to prove or refute this?


Partial answers will also be appreciated:

  • [We can easily determine $d|N_B]\impliedby[\gcd(B,d)>1]$
  • [We can easily determine $d|N_B]\impliedby[[gcd(B-1,d)>1]$
  • [We can easily determine $d|N_B]\implies[\gcd(B,d)>1]\vee[gcd(B-1,d)>1]$

The $1^{st}$ one is pretty trivial, I believe that the $2^{nd}$ one also holds, but I'm not sure about the $3^{rd}$ one.

barak manos
  • 43,109
  • Check that last line again, please! $gcd(B-1,d)$ is an integer, not a predicate. Also, shouldn't your $\wedge$ be a $\vee$? – TonyK Sep 03 '14 at 16:19
  • @TonyK: Question revised; thanks (for both comments). – barak manos Sep 03 '14 at 16:28
  • As your examples show, you are not just looking at B but also at powers of B. For example, the fact that $1001=7\times11\times13$ is the basis for the standard tests for 7, 11, 13 in base 10. Of course high powers of B are not much use, because few people are interested in mental calculation with huge numbers. – almagest Sep 03 '14 at 16:40
  • @almagest: I am seeking for an answer for each $B$ separately. – barak manos Sep 03 '14 at 17:29
  • @barak But I have just explained that your answer is wrong for any B. Look at B=10, d=7. It is relatively easy to determine if 7 is a divisor, but 7 does not have a common factor with 10 or 9. – almagest Sep 03 '14 at 19:20
  • @almagest: Can you please explain the standard test with which you easily determine whether or not a given number on base $10$ is divisible by $7$? In fact, if it is indeed a counterexample, then you can post it as an answer (to "Is there an easy way to prove or refute this?"). Thanks. – barak manos Sep 03 '14 at 19:27
  • $a_n\dots a_1a_0$ is divisible by 7, 11 or 13 iff $(a_2a_1a_0)-(a_5a_4a_3)+(a_8a_7a_6)-\dots$ is so divisible. – almagest Sep 03 '14 at 19:38
  • @almagest: Got it, thanks :) This one refutes the rule that I've established... If you care to add this as an answer, then I will gladly accept it... Thanks in any case. – barak manos Sep 04 '14 at 05:02

1 Answers1

1

Just to summarise some of the material in the comments and expand it slightly.

There is a well-known test for 7. $a_k\dots a_1a_0$ is divisible by 7 iff $(a_2a_1a_0)-(a_5a_4a_3)+(a_8a_7a_6)-\dots$ is divisible by 7. For example 12383. We divide the digits into groups 12 383 and subtract to get 371. That is divisible by 7, so 12383 is divisible by 7.

This approach can be used for divisors outside the range 2-9. The idea is to look for divisors of $B^k+1$. It also works for $B^k-1$ (but you add the groups instead of alternately adding and subtracting them. Since $1001=7\times11\times13$ the test for 7 can be used for 11 and 13 at the same time. For example, 371 is not divisible by 11 or 13, so 12383 is also not divisible by 11 or 13.

almagest
  • 18,380