Divisibility Rules for Large Prime Numbers: A Practical Guide

Divisibility Rules for Large Prime Numbers: A Practical Guide

Divisibility rules are essential tools for determining if a number is divisible by another, especially when dealing with large prime numbers. This article delves into the intricacies of devising and applying divisibility rules for prime numbers beyond 2 and 5, along with practical examples and techniques for large numbers.

General Divisibility Rule for Prime Numbers

The general rule for determining divisibility by prime numbers other than 2 or 5 involves modular arithmetic. The core of this method involves taking the last digit of the given number, finding the modular multiplicative inverse of 10 modulo the prime divisor, and applying an iterative process to determine divisibility.

Example:

To test the divisibility of 184 by 23:Find 10^{-1}mod23 which equals the last digit (4) by 7, yielding the original number to 18 and add the product from step 2, getting the process: 1828 mod 23 46 is divisible by 23, 184 is also divisible by 23.

Common Divisibility Rules for Smaller Integers

For smaller integers, standard divisibility rules are straightforward, which can be combined or adapted for working with primes.

Evenness Test

If a number is even, it is not prime (except for 2).

Example: 200 is ending in 0, thus it is divisible by 10 or 5.Example: 223 is odd and does not end in 0 or 5, making it a possible prime.

Divisibility by 3 and 9

A number is divisible by 3 if the sum of its digits is divisible by 3, and similarly for 9.

Example: For 223, the sum of digits is 7, which is not divisible by 3. However, for 222, the sum is 6, which is divisible by 3, so 222 is divisible by 3 and 9.

Divisibility by 4

A number is divisible by 4 if the number formed by its last two digits is divisible by 4.

Example: 1024 is divisible by 4 because 24 is divisible by 4.

Divisibility by 6

A number is divisible by 6 if it is even and the sum of its digits is divisible by 3.

Example: 1224 is even, and the sum of its digits (1 2 2 49) is divisible by 3, thus 1224 is divisible by 6.

Testing Large Numbers for Divisibility by a Given Prime

To test if a large number n is divisible by a given prime p, use the following method:

Divide p into n and check for no a table of powers of 10 modulo p to save time and example, with p 13:10 mod 13 10100 mod 13 91000 mod 13 90 mod 13 9 - 2 * 13 9 - 26 -17 -17 13 -4 9 - 4 9 13 - 4 1210000 mod 13 120 mod 13 12 - 9 * 13 12 - 117 -105 12 - 104 7 12 7 19 9 104 - 105 9 13 - 104 105 9 13 - 104 105 3100000 mod 13 30 mod 13 3 - 2 * 13 3 - 26 -23 -23 26 31000000 mod 13 300 mod 13 3000000 mod 13 3000000 mod 13 4 mod 13

Using this table, test the number 123456789:

Create 12103941253647181093 from the larger numbers: 1210 and 394, 125364 and 71810, and the resulting numbers recursively until a small, manageable number is obtained.

Conclusion

Applying these techniques and methods can significantly reduce the complexity of testing large numbers for divisibility by prime numbers. By leveraging modular arithmetic and precomputed tables, the process becomes more efficient and less prone to errors.