1

I'm interested with primorial number system. In this playful setting, out of curiosity and for relaxation, as an amateur, not knowing the current algorithms for decomposing a $2$-almost prime number $N$ $$N=pq$$I've come up with an algorithm that works well for $N<10^{18}$.

I want to improve the algorithm and your help would be welcome if you don't mind.


To present the algorithm,


1.- I choose $$\boxed{N=221=pq}$$ We have : $221\in 11+30\mathbb Z$ and $ \mathbb Z /30\mathbb Z\approx \mathbb Z/2\times \mathbb Z/3\times \mathbb Z/5 $ and $221\equiv1,2,1 \mod 2,3,5$

I'm looking for $p $ such that $$\begin{cases}p\in (1,1,a) \in \mathbb Z/2\times \mathbb Z/3\times \mathbb Z/5 \\ p>\color{blue}2\times 6 \color{red}{(*)}\end{cases} $$


2.- Here's how I use primorial number system :

We have to solve $$\begin{cases} p\equiv 1 \mod 2 &\color{green}{(a)} \\ p\equiv 1 \mod 3 &\color{Magenta} {(b)}\\p\equiv a \mod 5 &\color{green}{(c)}, \text{ with } a\in \{1,2,3,4,5\}\end{cases}$$

$\color{green}{a)}\exists k_0\in \mathbb Z, p=\color{blue}1+2k_0 $

$\color{Magenta} {b)}1+2k_0=1$ in $\mathbb Z/3Z$. So, $k_0=0+3k_1$. So, $p=\color{blue}1+\color{blue}0\times 2+6k_1$

$\color{green}{c)}1+k_1=a$ in $\mathbb Z/5$. So, $k_1=a-1+5k_2$

So, $p=\color{blue}1+\color{blue}0\times 2+\color{blue}{(a-1)}\times 6+30k_2$

According to $\color{red}{(*)}$, We just have to look at the cases $a=3,4,5$.

For $a=3$, ie $p=\color{blue}1+\color{blue}0\times 2+\color{blue}{2}\times 6=13$, what is written in Primorial number system$$\color{blue}{(2:0:1)}$$ it matches since $$\boxed {13\times 17=221}$$


Question: As I wrote, this algorithm works well for numbers below $10^{18}$, as the computation times then become too high on my PC.

I.- Could this be of mathematical interest to push it beyond this limit ?

II.- If not, can this be explained simply to an amateur like me? (I know almost nothing about complexity calculations for example)

III.- And if so, how? (in the notes, I indicate that I already have an idea)


Note :

  • I use a subroutine that provides me with the inverses and allows me to solve the simple modular equations that appear as I go along.

  • This algorithm makes me interested in how to multiply in Primorial number system.

  • With very large numbers, the algorithm must be forced to consider only a reasonable number of cases because of the computation times; Hence the idea of the constraint $\color{red}{(*)}$, which I still haven't put into practice in the python program I made.

  • I've done a lot of rating abuses for modular arithmetic calculations and there are notations clash. But they are so common that I thought they would not be very difficult.


Edit: To reply to @Peter's comment, the same technique appplies to $$N=40\,014\,989\,856\,514\,759$$ $$N\in (1,1,4,2,9,8,5,2)$$ For the computer, it matches with $$\begin{cases} p\in (1,1,2,1,8,8,6,13)\\ q\in (1,1,2,2,8,1,15,6) \end{cases}$$ We find $$\boxed{200\,018\,827\times 200\,056\,117}$$ (this is a document on which I had written "1 min" for my computer to provide the result)

  • 2
    To wake the interest of other users , demonstrate how you factor , say , a $16$-digit semiprime without a small factor this way. If this works efficiently (say being able to compete with known efficient methods like the quadratic sieve) , someone will surely examine it deeper. – Peter Apr 09 '24 at 10:24
  • 1
    Just for reference, using Mathematica running on a on a Raspberry Pi 5 it takes about $\frac{1}{1000}$ of a second to factor $40014989856514759=200018827 \cdot 200056117$. – Steven Clark Apr 09 '24 at 15:40
  • 2
    I find your algorithm description hard to follow, but perhaps posting your Python code would help to clarify your algorithm. – Steven Clark Apr 10 '24 at 01:59
  • 1
    Could you please characterize the properties of the integers for the "cases chosen by me"? Also, its not clear to me how you determine $p\in (1,1,a)$ or $\begin{cases} p\in (1,1,2,1,8,8,6,13)\ q\in (1,1,2,2,8,1,15,6) \end{cases}$ in your two examples. In your first example you introduce the variables $b$ and $c$ but never seem to use them, and the meaning of $p\equiv 1 \mod 3 (b)$ for example is also not clear to me. – Steven Clark Apr 10 '24 at 15:25
  • @StevenClark : Thank you for your interest. That's a lot of questions. I will try to answer them gradually. First, $N=221\equiv1,2,1 \mod 2,3,5$. So $N=pq\in (1,2,1)$. The only possibilities for $p$ and $q$ are $(p\in (1,2,c) \land q\in (1,1,d))$ or $(p\in (1,1,a) \land q\in (1,2,b))$. These two possibilities are "symetric". I chose to look for $p\in (1,1,a)$. – Stéphane Jaouen Apr 10 '24 at 15:51
  • 1
    I'm not sure I understand your notation. For example assuming $\mathbb Z$ is the set of integers, what does $221\in 11+30\mathbb Z$ mean? Does this mean $\exists k\in \mathbb Z: 221=11+30 k$? Assuming the notation at Modular arithmetic-Integers modulo m, by $\mathbb Z /30\mathbb Z\approx \mathbb Z/2\times \mathbb Z/3\times \mathbb Z/5$ do you mean the integers modulo $30$ can be derived from the integers modulo $2$, $3$, and $5$ via the Chinese remainder theorem? – Steven Clark Apr 27 '24 at 17:21

0 Answers0