mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > No Prime Left Behind

Reply
 
Thread Tools
Old 2022-05-30, 17:13   #1
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
Not U. + S.A.

23·3·97 Posts
Default Number of digits in prime

Quote:
Originally Posted by odicin View Post
Added 133982 : 993*2^1717566-1 (517042 digits) on port 2000
A little known program call mprint can generate the expression above. The order has to be different before it will accept it. "2^1717566-1*993" without the quotes.

This must be longer than 517,042 digits. Log(2) * 1717566 = 517,039. This is without the exponentiation, multiplication, and the subtraction of 1. I captured mprint's output to a file. It is 6,535,835 bytes in length. There are no extra characters beyond a CRLF at the end which accounts for only two bytes. mprint wrote it all as a single line. Only Notepad++ could open it.
storm5510 is offline   Reply With Quote
Old 2022-05-30, 22:38   #2
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2·1,487 Posts
Default

Using pfgw with
Code:
pfgw64 -od -q"993*2^1717566-1" >prime.txt
puts out the number in decimal expansion in a file of 517,097 bytes:
including the expression in front and some spaces at the end.
Deleting those will give the exact 517,042 digits (using only the standard Editor in WIN).
The number of digits you can also use WolframAlpha.
kar_bon is offline   Reply With Quote
Old 2022-05-31, 02:45   #3
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

10101011000102 Posts
Default

Quote:
Originally Posted by storm5510 View Post
This must be longer than 517,042 digits. Log(2) * 1717566 = 517,039. This is without the exponentiation, multiplication, and the subtraction of 1.
How many digits will multiplying by 993 add? Hint: 3. How many digits will subtracting 1 add?

I mean, you did the hard work to get 517,039... it boggles my mind that you faceplant when trying to get from there to 517,042.
VBCurtis is online now   Reply With Quote
Old 2022-05-31, 05:23   #4
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

7·23·41 Posts
Default

Python also agrees:
Code:
>>> len(str(993*2**1717566-1))
517042
retina is online now   Reply With Quote
Old 2022-05-31, 14:48   #5
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
Not U. + S.A.

1001000110002 Posts
Default

OK. I will take your word for it. No dispute.
.
.
It appears mprint assumes "2^" in front. What I actually did was 2^2^.....

Running mprint without parameters produces this:

Code:
USAGE: mprint p [base] [perfect]
       Outputs 2^p-1 in base base to stdout
       If you add the third parameter, it outputs 2^(p-1)*2^(p-1)
Yes, "base" appears twice in the second line.

Oh well, more of a curiosity than anything else.
storm5510 is offline   Reply With Quote
Old 2022-05-31, 15:08   #6
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23×32×47 Posts
Default

mprint only print Mersenne numbers 2p-1 but can print it in different bases for example decimal, hexidecimal etc.

To get the number of digits in k*bn + c:
First ignore "+ c" unless c is HUGE and/or b and n are very very small.

log (k*bn) = log(k) + n*log(b)

In your case: log10(993*2^1717566-1) = log10(993) + 1717566*log10(2) ~ 3 + 1717566*log10(2)


In general: log(a*b) = log(a) + log(b) and log(ab) = b*log(a)

Last fiddled with by ATH on 2022-05-31 at 15:09
ATH is offline   Reply With Quote
Old 2022-05-31, 16:49   #7
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

115110 Posts
Default

Quote:
Originally Posted by storm5510 View Post
Yes, "base" appears twice in the second line.
This likely means in "base {value of parameter [base]}" and that's why it is written twice.
kruoli is online now   Reply With Quote
Old 2022-05-31, 17:45   #8
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

2,287 Posts
Default

Code:
\\ I learned this from SM. In PARI-GP
allocatemem()
allocatemem()
allocatemem()
allocatemem()
length(Str(2^82589933 - 1))
##
Quote:
(13:41) gp > \\ I learned this from SM. In PARI-GP
(13:41) gp > allocatemem()
*** Warning: new stack size = 16000000 (15.259 Mbytes).
(13:41) gp > allocatemem()
*** Warning: new stack size = 32000000 (30.518 Mbytes).
(13:41) gp > allocatemem()
*** Warning: new stack size = 64000000 (61.035 Mbytes).
(13:41) gp > allocatemem()
*** Warning: new stack size = 128000000 (122.070 Mbytes).
(13:41) gp > length(Str(2^82589933 - 1))
%1 = 24862048
(13:41) gp > ##
*** last result computed in 8,767 ms.
Google agrees:

Largest known prime number

2^82,589,933 - 1
The Great Internet Mersenne Prime Search (GIMPS) has discovered the largest known prime number, 2^82,589,933 - 1, having 24,862,048 digits.

51st known Mersenne prime found | Announce - News


Last fiddled with by a1call on 2022-05-31 at 17:45
a1call is offline   Reply With Quote
Old 2022-06-01, 07:33   #9
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

B9E16 Posts
Default

Quote:
Originally Posted by storm5510 View Post
Code:
USAGE: mprint p [base] [perfect]
       Outputs 2^p-1 in base base to stdout
       If you add the third parameter, it outputs 2^(p-1)*2^(p-1)
Yes, "base" appears twice in the second line.
The perfect number of a Mersenne prime 2p-1 should read as 2p-1*(2p-1) instead.
kar_bon is offline   Reply With Quote
Old 2022-06-01, 20:15   #10
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

3·3,313 Posts
Default

Quote:
Originally Posted by kar_bon View Post
Using pfgw with
Code:
pfgw64 -od -q"993*2^1717566-1" >prime.txt
pfgw64 -od -q"{this or many other forms, including U(), gcd() etc}" | awk '{print length($2)}'
and done
___________________
Quote:
Quote:
Originally Posted by storm5510 View Post
Code:
USAGE: mprint p [base] [perfect]
       Outputs 2^p-1 in base base to stdout
       If you add the third parameter, it outputs 2^(p-1)*2^(p-1)
Yes, "base" appears twice in the second line.
The perfect number of a Mersenne prime 2p-1 should read as 2p-1*(2p-1) instead.
This shows care much care was put into mprint program. Simply don't use it; use better and much more developed tools: python, Pari/gp, pfgw and so on.
Batalov is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add repeated digits after a number until it is prime sweety439 sweety439 74 2022-05-17 19:28
Palindrome prime number of digits is always odd (except 11, and this is true in any base) bur And now for something completely different 13 2021-09-23 01:32
number of digits enzocreti enzocreti 1 2020-01-16 18:23
The "one billion minus 999,994,000" digits prime number a1call Miscellaneous Math 179 2015-11-12 14:59
how do you find number of digits of a 2^n number? Unregistered Math 11 2004-11-30 22:53

All times are UTC. The time now is 16:46.


Thu Sep 29 16:46:50 UTC 2022 up 42 days, 14:15, 0 users, load averages: 1.59, 1.52, 1.39

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, 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.

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