kb/data/en.wikipedia.org/wiki/Divisibility_rule-4.md

7.6 KiB
Raw Blame History

title chunk source category tags date_saved instance
Divisibility rule 5/8 https://en.wikipedia.org/wiki/Divisibility_rule reference science, encyclopedia 2026-05-05T08:13:56.367542+00:00 kb-cron

Finding remainder of a number when divided by 7 7 (1, 3, 2, 1, 3, 2, cycle repeats for the next six digits) Period: 6 digits. Recurring numbers: 1, 3, 2, 1, 3, 2 Minimum magnitude sequence (1, 3, 2, 6, 4, 5, cycle repeats for the next six digits) Period: 6 digits. Recurring numbers: 1, 3, 2, 6, 4, 5 Positive sequence Multiply the right most digit by the left most digit in the sequence and multiply the second right most digit by the second left most digit in the sequence and so on and so for. Next, compute the sum of all the values and take the modulus of 7. Example: What is the remainder when 1036125837 is divided by 7? Multiplication of the rightmost digit = 1 × 7 = 7 Multiplication of the second rightmost digit = 3 × 3 = 9 Third rightmost digit = 8 × 2 = 16 Fourth rightmost digit = 5 × 1 = 5 Fifth rightmost digit = 2 × 3 = 6 Sixth rightmost digit = 1 × 2 = 2 Seventh rightmost digit = 6 × 1 = 6 Eighth rightmost digit = 3 × 3 = 9 Ninth rightmost digit = 0 Tenth rightmost digit = 1 × 1 = 1 Sum = 33 33 modulus 7 = 5 Remainder = 5 Digit pair method of divisibility by 7 This method uses 1, 3, 2 pattern on the digit pairs. That is, the divisibility of any number by seven can be tested by first separating the number into digit pairs, and then applying the algorithm on three digit pairs (six digits). When the number is smaller than six digits, then fill zero's to the right side until there are six digits. When the number is larger than six digits, then repeat the cycle on the next six digit group and then add the results. Repeat the algorithm until the result is a small number. The original number is divisible by seven if and only if the number obtained using this algorithm is divisible by seven. This method is especially suitable for large numbers. Example 1: The number to be tested is 157514. First we separate the number into three digit pairs: 15, 75 and 14. Then we apply the algorithm: 1 × 15 3 × 75 + 2 × 14 = 182 Because the resulting 182 is less than six digits, we add zero's to the right side until it is six digits. Then we apply our algorithm again: 1 × 18 3 × 20 + 2 × 0 = 42 The result 42 is divisible by seven, thus the original number 157514 is divisible by seven. Example 2: The number to be tested is 15751537186. (1 × 15 3 × 75 + 2 × 15) + (1 × 37 3 × 18 + 2 × 60) = 180 + 103 = 77 The result 77 is divisible by seven, thus the original number 15751537186 is divisible by seven. Another digit pair method of divisibility by 7 Method This is a non-recursive method to find the remainder left by a number on dividing by 7:

Separate the number into digit pairs starting from the ones place. Prepend the number with 0 to complete the final pair if required. Calculate the remainders left by each digit pair on dividing by 7. Multiply the remainders with the appropriate multiplier from the sequence 1, 2, 4, 1, 2, 4, ... : the remainder from the digit pair consisting of ones place and tens place should be multiplied by 1, hundreds and thousands by 2, ten thousands and hundred thousands by 4, million and ten million again by 1 and so on. Calculate the remainders left by each product on dividing by 7. Add these remainders. The remainder of the sum when divided by 7 is the remainder of the given number when divided by 7.

For example: The number 194,536 leaves a remainder of 6 on dividing by 7. The number 510,517,813 leaves a remainder of 1 on dividing by 7. Proof of correctness of the method The method is based on the observation that 100 leaves a remainder of 2 when divided by 7. And since we are breaking the number into digit pairs we essentially have powers of 100. 1 mod 7 = 1 100 mod 7 = 2 10,000 mod 7 = 2^2 = 4 1,000,000 mod 7 = 2^3 = 8; 8 mod 7 = 1 100,000,000 mod 7 = 2^4 = 16; 16 mod 7 = 2 10,000,000,000 mod 7 = 2^5 = 32; 32 mod 7 = 4 And so on. The correctness of the method is then established by the following chain of equalities: Let N be the given number

            a
            
              2
              n
            
          
          
            a
            
              2
              n
              
              1
            
          
          .
          .
          .
          
            a
            
              2
            
          
          
            a
            
              1
            
          
        
        ¯
      
    
  

{\displaystyle {\overline {a_{2n}a_{2n-1}...a_{2}a_{1}}}}

.

            a
            
              2
              n
            
          
          
            a
            
              2
              n
              
              1
            
          
          .
          .
          .
          
            a
            
              2
            
          
          
            a
            
              1
            
          
        
        ¯
      
    
    
    mod
    
    
    7
  

{\displaystyle {\overline {a_{2n}a_{2n-1}...a_{2}a_{1}}}\mod 7}




  
    [
    
      ∑
      
        k
        =
        1
      
      
        n
      
    
    (
    
      a
      
        2
        k
      
    
    
      a
      
        2
        k
        
        1
      
    
    )
    ×
    
      10
      
        2
        k
        
        2
      
    
    ]
    
      mod
      
        7
      
    
  

{\displaystyle [\sum _{k=1}^{n}(a_{2k}a_{2k-1})\times 10^{2k-2}]{\bmod {7}}}




  
    
      ∑
      
        k
        =
        1
      
      
        n
      
    
    (
    
      a
      
        2
        k
      
    
    
      a
      
        2
        k
        
        1
      
    
    ×
    
      10
      
        2
        k
        
        2
      
    
    )
    
      mod
      
        7
      
    
  

{\displaystyle \sum _{k=1}^{n}(a_{2k}a_{2k-1}\times 10^{2k-2}){\bmod {7}}}




  
    
      ∑
      
        k
        =
        1
      
      
        n
      
    
    (
    
      a
      
        2
        k
      
    
    
      a
      
        2
        k
        
        1
      
    
    
      mod
      
        7
      
    
    )
    ×
    (
    
      10
      
        2
        k
        
        2
      
    
    
      mod
      
        7
      
    
    )
  

{\displaystyle \sum _{k=1}^{n}(a_{2k}a_{2k-1}{\bmod {7}})\times (10^{2k-2}{\bmod {7}})}