mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2021-09-18, 23:29   #1
LarsNet
 
Mar 2021

1011002 Posts
Minus 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
LarsNet is offline   Reply With Quote
Old 2021-09-18, 23:44   #2
LarsNet
 
Mar 2021

22·11 Posts
Default

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
LarsNet is offline   Reply With Quote
Old 2021-09-19, 04:32   #3
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

3C316 Posts
Default

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.
Happy5214 is offline   Reply With Quote
Old 2021-09-19, 11:36   #4
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

240558 Posts
Default

Quote:
Originally Posted by LarsNet View Post
(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?
LaurV is offline   Reply With Quote
Old 2021-09-19, 14:08   #5
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

26·32·11 Posts
Default

Quote:
Originally Posted by LarsNet View Post
<snip>
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.
Dr Sardonicus is offline   Reply With Quote
Old 2021-09-21, 01:10   #6
LarsNet
 
Mar 2021

22×11 Posts
Default

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
LarsNet is offline   Reply With Quote
Old 2021-09-21, 03:16   #7
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

165D16 Posts
Default

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.
VBCurtis is offline   Reply With Quote
Old 2021-09-22, 20:58   #8
LarsNet
 
Mar 2021

548 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
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
LarsNet is offline   Reply With Quote
Old 2021-09-22, 21:21   #9
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

52·229 Posts
Default

"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.
VBCurtis is offline   Reply With Quote
Old 2021-09-22, 21:43   #10
LarsNet
 
Mar 2021

22×11 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
"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!
LarsNet is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
(M48) NEW MERSENNE PRIME! LARGEST PRIME NUMBER DISCOVERED! dabaichi News 571 2020-10-26 11:02
mersenne prime number application? Tamay82 Information & Answers 3 2018-09-08 16:34
Number of distinct prime factors of a Double Mersenne number aketilander Operazione Doppi Mersennes 1 2012-11-09 21:16
Probability of a Mersenne number being prime vimil Information & Answers 13 2007-12-12 11:21
40th Prime Mersenne Number? Unregistered Software 7 2003-12-05 09:12

All times are UTC. The time now is 23:04.


Thu Mar 30 23:04:20 UTC 2023 up 224 days, 20:32, 0 users, load averages: 1.31, 0.94, 0.76

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔