View Single Post
Old 2021-09-13, 18:28   #10
Mar 2021

22·11 Posts

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

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()
LarsNet is offline   Reply With Quote