1

The wikipedia page for divisibility rule for 7 has an interesting method. Which I am elaborating and generalizing.

  • let a number N. Make pairs of the number starting from right.
  • find remainders for each pair. let remainders be R0,R1,R2,R3.. .
  • Then the number N is divisible by 7 if R0X2^0 + R1X2^1+R2X2^2+R3X2^3... is divisible by 7.
  • eg
  • 194,536: 19|45|36 ; (5x4) + (3x2) + (1x1) = 27, so it is not divisible by 7
  • 204,540: 20|45|40 ; (6x4) + (3x2) + (5x1) = 35, so it is divisible by 7
  • 1,655,598: 1|65|55|98 ; (1x8) + (2x4) + (6x2) + (0*1) = 28, so it is divisible by 7
  • can this be proved?
  • the system may give easier results if we take negative remainders(in case remainders are 5,6 we can take remainder as -2,-1)
Bill Dubuque
  • 265,059
  • 37
  • 279
  • 908

1 Answers1

2

Yes, this works because $1 \equiv 1 \pmod 7$, $100 \equiv 2 \pmod 7$, $100^2 \equiv 2^2 \pmod 7$ and so on.

This also uses the property that $a \pmod c + b \pmod c \equiv (a + b) \pmod c$, so the remainder $\text{mod } 7$ of the whole number can be found by adding the remainders of each pair times the place values ($100, 100^2 , 100^3$).

Toby Mak
  • 16,704
  • 4
  • 25
  • 46
  • See [modular arithmetic](https://en.wikipedia.org/wiki/Modular_arithmetic) if you are confused. – Toby Mak Apr 24 '21 at 11:03
  • Thanks. so the question can be modified as Then the number N is divisible by 7 if R0X1 + R1X2+R2X4+R3X1 +R4X2 +R5X4... is divisible by 7. because 100^3=1, 100^4=2 and so on. thanks for quick answer – anshul aman Apr 24 '21 at 11:17
  • Yes, that's correct. – Toby Mak Apr 24 '21 at 11:49
  • Please strive not to add more dupe answers to dupes of FAQs. – Bill Dubuque Apr 24 '21 at 17:17
  • @BillDubuque I will take this in mind. Your suggestion would be better phrased as: "please check the question is not a duplicate (using Approach0) before answering" as most users who answer do not realise that they are answering a dupe question. – Toby Mak Apr 25 '21 at 08:22