While i'm learning PARI/GP, i added a runnable version of this on replit:

https://replit.com/@oppressionslyr/M...arison#main.py
You can change the bottom number to other numbers other than 2**43-1 and hit run again. This is not using gmpy2 (so is slow) and will not work with 2**49-1 since 127 factor is lower , than the first equations answer of (46+47-1)*2+3 and ((46+47-1)+1)*2+3. I'm sure i could tweak the offset to fix that if needed. My suggestion is to stay below 2**71-1, just because it's slow for larger numbers

THIS VERSION finds all factors instead of the first which i posted, all climbing from the same offset of the bit_length()