Posts

The impacts of known prime generation patterns

I always believed that prime numbers don't follow any clear pattern, but yesterday I learned from this page [1] that any prime number bigger than 3 can follow the pattern (6*n+1) and/or (6*n -1), where n is any natural number. The authors indicate that they verified this theory by generating 1000000 prime numbers using Matlab. Therefore, it seems that there is no official proof of this theory, but also nothing proves that it is an incorrect theory.  Let's suppose that this theory is mathematically proven. Then, two questions can be raised: Question1: Can this theory remove the need to primality tests? Question2: Can this theory allow us to factorize natural numbers efficiently? Before I handle these questions, I want to verify first the prime generation theory. I wrote a Python function that allows finding the count of prime numbers within a range of numbers and comparing this function with another function that follows the brute force method to generate the prime numbers. Here...

When does modular division return multiple solutions?

Modular arithmetic is very important to cryptography. It is arithmetic that allows us to achieve a set of operations over a set of numbers that wrap around a circle.   While modular addition, subtraction, and multiplication are easy to understand, the modular division is somehow tricky. The main reason is that the modular division doesn't have always a solution, and sometimes it gives multiple solutions! To explain it clearly, I present two approaches to calculating the modular division. The first approach uses the modular multiplication table, while the second approach uses the successive subtraction method. Both approaches allow us to see whether there are zero, one, or multiple solutions to the modular division. However, none of these approaches are efficient to calculate the modular division of big numbers.  The objective of this article is to explain when the modular division can have zero, one or multiple solutions.  The article s...