mersenneforum.org 3x a mersenne prime seems to have a prime nearby by less than twice the mersenne number
 Register FAQ Search Today's Posts Mark Forums Read

2021-09-18, 23:29   #1
LarsNet

Mar 2021

22·11 Posts
3x a mersenne prime seems to have a prime nearby by less than twice the mersenne number

I noticed this and wondered if anyone has ever went on this path to find a large prime to put in the database. I haven't bought my rig yet to start working on the project for mersennes, but will soon and was just curious about this one as it seems fun to try maybe. Probably not enough cpu power for the is_prime tests, heh.

Quote:
 In [2511]: for x in mersenne[0:21]: ...: z = 3 * 2**x-1 ...: g = gmpy2.next_prime(z) ...: print(x, g-z) ...: 3 6 5 2 7 6 13 18 17 26 19 6 31 24 61 48 89 44 107 170 127 18 521 546 607 510 1279 18 2203 1964 2281 2748 3217 546 4253 1356 4423 2720
I just did the math and see why such a search path wouldn't be very fruitful, nevermind :-)

Last fiddled with by LarsNet on 2021-09-18 at 23:32

 2021-09-18, 23:44 #2 LarsNet   Mar 2021 22·11 Posts Since i posted something not so useful,i thought i'd share something interesting ( nothing new, just something old and interesting): If you run any mersenne number in the following equation, you will always get a bin of repeating 1's and 0's. Code: In [2521]: bin((2**107-1)*((2**107-1)//3)-1) Out[2521]: '0b101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100110101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101' Hang on my math is wrong, i know i'm just missing something simple, because: Code: In [2566]: p2ecm(8776024305713098891493168973639202693241257950045759271192581461) Out[2566]: [643, 84115747449047881488635567801, 162259276829213363391578010288127] 162259276829213363391578010288127//3+1 = 643 * 84115747449047881488635567801 In [2567]: bin(8776024305713098891493168973639202693241257950045759271192581461) Out[2567]: '0b101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101' but i'll update it later, i confused myself and have been working on math problems all day so a little brain dead. Ok HERE we go: Code: In [1615]: bin((2**107-1)*((2**107-1)//3+1)) Out[1615]: '0b101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101' And to create a hilo map (this is an original discovery as far as i know while studying primes ) meaning map 1 to 5 through 9 and 0 to 0 through 4, use this equation: Code: a = 2**61-1 # 2305843009213693951 z = a + a z = int(str(z),16) h = (int(str(a), 16) + int(str(a), 16)) print(hex((z-h)//6) 2305843009213693951 0001100001000110110 The 0's align with 0-4 above the binary, and 1's align with 5-9 above the hex of (z-h)//6. The binary is in the hex, nice. Last fiddled with by retina on 2021-09-19 at 05:36 Reason: Long lines are long
 2021-09-19, 04:32 #3 Happy5214     "Alexander" Nov 2008 The Alamo City 3·52·11 Posts Can a mod please get some [CODE] tags in that post? It overflowed my screen width, and I'm sure I wasn't the only one.
2021-09-19, 11:36   #4
LaurV
Romulan Interpreter

"name field"
Jun 2011
Thailand

272516 Posts

Quote:
 Originally Posted by LarsNet (this is an original discovery as far as i know while studying primes )
wow, you just discovered that if you take a number which is 1111...111 in binary and multiply it with about a third of it, you get 101010... Now, think about it viceversa, take any binary number which is a string of 1 (it can also be a string of 1 in any base) and divide it by 3 (which is binary is 11, but if you use other base, take 11 in that base, for example, in base ten, take eleven), and do the school division, with pencil and paper. What do you see?

2021-09-19, 14:08   #5
Dr Sardonicus

Feb 2017
Nowhere

134338 Posts

Quote:
 Originally Posted by LarsNet And to create a hilo map (this is an original discovery as far as i know while studying primes ) meaning map 1 to 5 through 9 and 0 to 0 through 4, use this equation: Code: a = 2**61-1 # 2305843009213693951 z = a + a z = int(str(z),16) h = (int(str(a), 16) + int(str(a), 16)) print(hex((z-h)//6) 2305843009213693951 0001100001000110110 The 0's align with 0-4 above the binary, and 1's align with 5-9 above the hex of (z-h)//6. The binary is in the hex, nice.
Congratulations. You've discovered that in the decimal addition a + a, there's a carry from places whose digits are greater than 4, and no carry from places whose digits are less than 5.

 2021-09-21, 01:10 #6 LarsNet   Mar 2021 22×11 Posts Yes, i'm a newbie, but i love what i've discovered and have a love for prime numbers and would like to help with the project if any of you have any ideas on what i can buy to contribute (while not much, but enough i hope (5 to 7k)) i would like to help: https://www.mersenneforum.org/showthread.php?t=27150
 2021-09-21, 03:16 #7 VBCurtis     "Curtis" Feb 2005 Riverside, CA 17×317 Posts Is your interest Mersennes only, primes of some other forms, or factoring too? Those are the three main categories this forum's users work on. If you're searching for primes, the best bang-for-buck isn't a massive $5k machine; it's a gaming-class machine with fast memory, and if a GPU can be found at reasonable price then the GPU can do perhaps more work than all the cores of the CPU (depending on how nice a GPU one can locate, of course). GPU software is best cut out for Mersenne work, while the CPU can search for Mersennes too, or other primes of smaller size, or yet other projects around here. 2021-09-22, 20:58 #8 LarsNet Mar 2021 22×11 Posts Quote:  Originally Posted by VBCurtis Is your interest Mersennes only, primes of some other forms, or factoring too? Those are the three main categories this forum's users work on. If you're searching for primes, the best bang-for-buck isn't a massive$5k machine; it's a gaming-class machine with fast memory, and if a GPU can be found at reasonable price then the GPU can do perhaps more work than all the cores of the CPU (depending on how nice a GPU one can locate, of course). GPU software is best cut out for Mersenne work, while the CPU can search for Mersennes too, or other primes of smaller size, or yet other projects around here.
To be honest, i spend a lot of my time (right now, it changes from one thing to another, mostly dealing with Mersennes) studying lucas-lehmer and really studying it and finding somewhat faster versions ( nothing worthy of sharing, it's just for gaining personal knowledge in a fun way ), so saying that i'd say Mersennes are my primary driver here, but i've written my own factoring engine ( based on what's out there already ) and am trying to write an nfs or gnfs engine, i just don't understand the math enough yet, so that's my secondary driver.

I do have a speedy Core I7 laptop that i could use for this project, an MSI Creator 17 A10SGS-252 which has :

Creator 17 A10SGS-252
CPU Core i7-10875H; 2.3 - 5.1GHz
GPU NVIDIA GeForce RTX2080 Super Max-Q

Is that good enough a machine?

BTW, i bought Elementary Number Theory: Primes, Congruences, and Secrets by William Stein to help me understand some of the material regarding nfs/gnfs. If anyone has any other recommendations, i'd love to hear it. (I'm struggling with putting the concept of ideals into code )

Last fiddled with by LarsNet on 2021-09-22 at 21:17

 2021-09-22, 21:21 #9 VBCurtis     "Curtis" Feb 2005 Riverside, CA 17·317 Posts "good enough" is a matter of your level of patience. The only limitation that machine has other than "time spent to get a result" is that RAM installed limits the maximum size of NFS job you can run. An 8GB machine tops out around GNFS-165 if running msieve + GGNFS, and more like GNFS 150 digits if running CADO. 16GB gets you about 15 digits larger capacity, though by that size your patience likely limits you as much as memory capacity. For any other task run on this forum, your machine is fine- it may take twice as long, but so what? If your interests get varied or intense enough to want to be able to run more tasks (or run tasks more quickly), then you know it's time to acquire a faster machine.
2021-09-22, 21:43   #10
LarsNet

Mar 2021

22×11 Posts

Quote:
 Originally Posted by VBCurtis "good enough" is a matter of your level of patience. The only limitation that machine has other than "time spent to get a result" is that RAM installed limits the maximum size of NFS job you can run. An 8GB machine tops out around GNFS-165 if running msieve + GGNFS, and more like GNFS 150 digits if running CADO. 16GB gets you about 15 digits larger capacity, though by that size your patience likely limits you as much as memory capacity. For any other task run on this forum, your machine is fine- it may take twice as long, but so what? If your interests get varied or intense enough to want to be able to run more tasks (or run tasks more quickly), then you know it's time to acquire a faster machine.
I have 64gb of ram, so sounds like i'll be thinking of what to do next with my laptop. Thank you for the info!

 Similar Threads Thread Thread Starter Forum Replies Last Post dabaichi News 571 2020-10-26 11:02 Tamay82 Information & Answers 3 2018-09-08 16:34 aketilander Operazione Doppi Mersennes 1 2012-11-09 21:16 vimil Information & Answers 13 2007-12-12 11:21 Unregistered Software 7 2003-12-05 09:12

All times are UTC. The time now is 10:02.

Thu Aug 18 10:02:25 UTC 2022 up 7:30, 0 users, load averages: 1.09, 1.08, 1.08