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)