Difference between revisions of "Divisibility rules/Rule 1 for 7 proof"

(first draft)
 
m (Proof)
Line 6: Line 6:
 
Then <math>N = 10^{3k-1} a_{3k-1} + 10^{3k-2} a_{3k-2} + 10^{3k-3} a_{3k-3} \cdots + 10^8 a_8 + 10^7 a_7 + 10^6 a_6 + 10^5 a_5 + 10^4 a_4 + 10^3 a_3 + 10^2 a_2 + 10 a_1 + a_0.</math>
 
Then <math>N = 10^{3k-1} a_{3k-1} + 10^{3k-2} a_{3k-2} + 10^{3k-3} a_{3k-3} \cdots + 10^8 a_8 + 10^7 a_7 + 10^6 a_6 + 10^5 a_5 + 10^4 a_4 + 10^3 a_3 + 10^2 a_2 + 10 a_1 + a_0.</math>
 
<math>= 1000^{k-1} (100 a_{3k-1} + 10 a_{3k-2} + a_{3k-3}) \cdots + 1000^2 (100 a_8 + 10 a_7 + a_6) + 1000 (100 a_5 + 10 a_4 + a_3) + (100 a_2 + 10 a_1 + a_0).</math>
 
<math>= 1000^{k-1} (100 a_{3k-1} + 10 a_{3k-2} + a_{3k-3}) \cdots + 1000^2 (100 a_8 + 10 a_7 + a_6) + 1000 (100 a_5 + 10 a_4 + a_3) + (100 a_2 + 10 a_1 + a_0).</math>
Rewriting as 3 digit numbers, that is, partitioning <math>N</math> into 3 digit numbers (<math>a_{3k-1}a_{3k-2}a_{3k-3}\cdots a_8a_7a_6 a_5a_4a_3 a_2a_1a_0</math>).
 
<math>= 1000^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + 1000^2 (a_8a_7a_6) + 1000 (a_5a_4a_3) + (a_2a_1a_0).</math>
 
  
Since <math>1000\equiv -1\pmod{7}</math>,
+
Rewriting or partitioning <math>N</math> into 3 digit numbers (<math>a_{3k-1}a_{3k-2}a_{3k-3}\cdots a_8a_7a_6 a_5a_4a_3 a_2a_1a_0</math>).
 +
<math>N = 1000^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + 1000^2 (a_8a_7a_6) + 1000 (a_5a_4a_3) + (a_2a_1a_0).\\
 +
\equiv (-1)^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + (-1)^2 (a_8a_7a_6) - (a_5a_4a_3) + (a_2a_1a_0) \pmod {7}, \text{since} 1000\equiv -1\pmod{7} </math>
  
<math> 1000^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + 1000^2 (a_8a_7a_6) + 1000 (a_5a_4a_3) + (a_2a_1a_0)</math>
 
<math>\equiv (-1)^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + (-1)^2 (a_8a_7a_6) - (a_5a_4a_3) + (a_2a_1a_0) \pmod {7}. </math>
 
  
 
This is the alternating sum of groups of 3 digit numbers of <math>N</math>, which is what we wanted.
 
This is the alternating sum of groups of 3 digit numbers of <math>N</math>, which is what we wanted.

Revision as of 21:17, 25 November 2023

Proof

This is based on divisibility by 11 rule

Assume N has 3k digits, otherwise add zeros to the left. WLOG let $N = a_{3k-1}a_{3k-2}a_{3k-3}\cdots a_8a_7a_6a_5a_4a_3a_2a_1a_0$ where the $a_i$ are base-ten numbers. Then $N = 10^{3k-1} a_{3k-1} + 10^{3k-2} a_{3k-2} + 10^{3k-3} a_{3k-3} \cdots + 10^8 a_8 + 10^7 a_7 + 10^6 a_6 + 10^5 a_5 + 10^4 a_4 + 10^3 a_3 + 10^2 a_2 + 10 a_1 + a_0.$ $= 1000^{k-1} (100 a_{3k-1} + 10 a_{3k-2} + a_{3k-3}) \cdots + 1000^2 (100 a_8 + 10 a_7 + a_6) + 1000 (100 a_5 + 10 a_4 + a_3) + (100 a_2 + 10 a_1 + a_0).$

Rewriting or partitioning $N$ into 3 digit numbers ($a_{3k-1}a_{3k-2}a_{3k-3}\cdots a_8a_7a_6 a_5a_4a_3 a_2a_1a_0$). $N = 1000^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + 1000^2 (a_8a_7a_6) + 1000 (a_5a_4a_3) + (a_2a_1a_0).\\ \equiv (-1)^{k-1} (a_{3k-1}a_{3k-2}a_{3k-3}) \cdots + (-1)^2 (a_8a_7a_6) - (a_5a_4a_3) + (a_2a_1a_0) \pmod {7}, \text{since} 1000\equiv -1\pmod{7}$


This is the alternating sum of groups of 3 digit numbers of $N$, which is what we wanted.

See also