You can even optimize more: If we define a “branch” as the set of odd numbers having the same number as “next odd” in a collatz trajectory (e.g. 7, 29, 117,… all have 11 as “next odd” in a trajectory), we know that a trajectory never have two numbers of the same branch (a trajectory can’t have 7 and 29 in its path to 1 or infinity), so we can bound all trajectories by the root (smallest odd number) of the branch. If the root is a multiple of 3, we just take the next smallest (which is root*4+1).
The roots are either of the form 8n+1 or 4n+3. This can be split into 24n+1, 24n+9 a multiple of 3 for which we take the next smallest or 96n+37, 24n+17 and 12n+3 for which we take 48n+13, 12n+7 and 12n+11. For 1 we take the next smallest which is 5.
This means that the bound can be extended from 582 to 1106 (all trajectories less or equal to 1106 have Res(N)<2)
PariGP code:
prod6n()=a0=5;a1=1;n=0;while(a1<2,if((a0%6==1||a0%6==5)&&(a0%24==1||a0%24==17||a0%12==7||a0%12==11||a0%96==37||a0%48==13||a0==5),n=n+1;a1=a1*(1+1/(3*a0)));a0=a0+1);return(n)
Here you can also take the starting number greater than 10^6