Someone to help me find large prime number? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Someone to help me find large prime number?

I were thinking about prime numbers and I found something... I want to test it... there are prime number 3, 7, 127 - these primes have something in common all are only 1 in binary, next should be 170141183460469231731687303715884105727 (2^128-1), online prime testers confirmed that, this leads me to the point - next prime number in sequence should be 2^170141183460469231731687303715884105728-1

22nd Nov 2020, 8:47 PM
nicolas turek
nicolas turek - avatar
16 Answers
+ 2
You found the Mersenne primes. A binary with only 1 is a decimal 2**n-1. A Mersenne number If it is a prime it is a Mersenne prime.
22nd Nov 2020, 9:07 PM
Oma Falk
Oma Falk - avatar
+ 2
Your number is the 5th Catalane-Mersenne number (https://mathworld.wolfram.com/Catalan-MersenneNumber.html). It is not currently known if it is a prime or not (after all, the largest known prime is "just" 2^82589933 - 1). It is known that this number has no prime factors below 10^51 (it is is obvious that it doesn't have any factors below 2^127 - 1, for otherwise 2^127-1 would be composite itself -- i guess they continued this train of to 10^51 - showing that there is no prime p up to 10^51 such that 2^k modulo p can have exactly 2^127-1 different values)
23rd Nov 2020, 7:51 AM
Volodymyr Chelnokov
Volodymyr Chelnokov - avatar
+ 2
If your modulo is small enough that you can fit it in memory you can calculate 2^(2^127-1) mod p by 127 repeated squarings and a (modular) division by 2 at the end. The problem is that we know that "interesting" numbers p are also large, and also that there's a huge number of them. You can, of course, try testing divisibility by primes P satisfying the following necessary conditions: P>10^51 P=2k * (2^127-1) + 1 maybe you'll have a lucky guess and find a divisor. Smarter methods of prime testing require calculations modulo the number you are testing, and i guess here we are out of luck - while the number itself has a simple description, the intermediate results may be anything up to this number, and that will not fit in any reasonable amount of memory
23rd Nov 2020, 8:46 AM
Volodymyr Chelnokov
Volodymyr Chelnokov - avatar
+ 1
Yes and if u discovered yourself..... Looks like you are mathematican
23rd Nov 2020, 6:55 AM
Oma Falk
Oma Falk - avatar
+ 1
Well... It's complicated even getting this number, because of it's size... So I gues It'll take a lot time to calculate but I gues that it should be easier than other primes since it's all same in binary, so it can be divided part by part and don't have to be memorized whole (just size of dividing number), but it's not possible as decimal number, only in binary
23rd Nov 2020, 7:59 AM
nicolas turek
nicolas turek - avatar
+ 1
Well... During calculation we can save highest part of number and how far it's from 0, that makes it possible to do testing up to size of memory... To do it fast would be good do begining with ram, but for further test... There Will be need of using hdd... And here comes a big problem
23rd Nov 2020, 8:51 AM
nicolas turek
nicolas turek - avatar
+ 1
And I gues that there is no memory which could store such large number as squere root of this
23rd Nov 2020, 8:52 AM
nicolas turek
nicolas turek - avatar
+ 1
So these days we can't fully test it
23rd Nov 2020, 8:52 AM
nicolas turek
nicolas turek - avatar
+ 1
nicolas turek i worked on divisibility and binaries with FSM. It was exciting. https://code.sololearn.com/cjR8Y5Ijn9iO/?ref=app
23rd Nov 2020, 9:12 AM
Oma Falk
Oma Falk - avatar
+ 1
I would be more for python than javasvript, since python is better at large number operations... But maybe I'll do it in C since even Python number size limit is not enough
23rd Nov 2020, 9:35 AM
nicolas turek
nicolas turek - avatar
+ 1
madeline No, if it was that simple I wouldn't ask :D but thanks, I didn't knew about this method of getting primes
24th Nov 2020, 8:10 PM
nicolas turek
nicolas turek - avatar
0
Maybe it's prime, maybe not... I would gues it is, but it's number with size of... You see there, you would need really big memory to store such a huge number, so this is not way to calculate it... Only thing I know is it is number with 1701...5727 digits in binary and all are 1...
22nd Nov 2020, 9:22 PM
nicolas turek
nicolas turek - avatar
0
At least it's really interesting number sequence :D
22nd Nov 2020, 9:27 PM
nicolas turek
nicolas turek - avatar
0
More programmer, it's from binary -> you take 11 (that's 3) and use this amount of 1 in next number -> 111 (7) -> 1111111(127)... Reason for these to be primes could be, that they actually all were done by not being possible to diveded by previous (so my number surely is not divideable by these + 2...), Now I need code to divide binary which will remeber only in which part of this number it is and rest begining at left side... So I'll need my own modulo function
23rd Nov 2020, 7:02 AM
nicolas turek
nicolas turek - avatar
0
cool finding! i wonder: could you test it thru the Sieve of Eratosthenes?
24th Nov 2020, 7:57 PM
madeline
madeline - avatar
0
nicolas turek o ok lol no problem
24th Nov 2020, 8:12 PM
madeline
madeline - avatar