20220530, 17:13  #1  
Random Account
Aug 2009
Not U. + S.A.
2^{2}·7·83 Posts 
Number of digits in prime
Quote:
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. 

20220530, 22:38  #2 
Mar 2006
Germany
3×991 Posts 
Using pfgw with
Code:
pfgw64 od q"993*2^17175661" >prime.txt 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. 
20220531, 02:45  #3  
"Curtis"
Feb 2005
Riverside, CA
5,471 Posts 
Quote:
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. 

20220531, 05:23  #4 
Undefined
"The unspeakable one"
Jun 2006
My evil lair
1100111000100_{2} Posts 
Python also agrees:
Code:
>>> len(str(993*2**17175661)) 517042 
20220531, 14:48  #5 
Random Account
Aug 2009
Not U. + S.A.
2^{2}·7·83 Posts 
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^p1 in base base to stdout If you add the third parameter, it outputs 2^(p1)*2^(p1) Oh well, more of a curiosity than anything else. 
20220531, 15:08  #6 
Einyen
Dec 2003
Denmark
17×199 Posts 
mprint only print Mersenne numbers 2^{p}1 but can print it in different bases for example decimal, hexidecimal etc.
To get the number of digits in k*b^{n} + c: First ignore "+ c" unless c is HUGE and/or b and n are very very small. log (k*b^{n}) = log(k) + n*log(b) In your case: log_{10}(993*2^17175661) = log_{10}(993) + 1717566*log_{10}(2) ~ 3 + 1717566*log_{10}(2) In general: log(a*b) = log(a) + log(b) and log(a^{b}) = b*log(a) Last fiddled with by ATH on 20220531 at 15:09 
20220531, 16:49  #7 
"Oliver"
Sep 2017
Porta Westfalica, DE
1140_{10} Posts 

20220531, 17:45  #8  
"Rashid Naimi"
Oct 2015
Remote to Here/There
100011101111_{2} Posts 
Code:
\\ I learned this from SM. In PARIGP allocatemem() allocatemem() allocatemem() allocatemem() length(Str(2^82589933  1)) ## Quote:
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 20220531 at 17:45 

20220601, 07:33  #9 
Mar 2006
Germany
3·991 Posts 
The perfect number of a Mersenne prime 2^{p}1 should read as 2^{p1}*(2^{p}1) instead.

20220601, 20:15  #10  
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
2×4,967 Posts 
pfgw64 od q"{this or many other forms, including U(), gcd() etc}"  awk '{print length($2)}'
and done ___________________ Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Add repeated digits after a number until it is prime  sweety439  sweety439  74  20220517 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  20210923 01:32 
number of digits  enzocreti  enzocreti  1  20200116 18:23 
The "one billion minus 999,994,000" digits prime number  a1call  Miscellaneous Math  179  20151112 14:59 
how do you find number of digits of a 2^n number?  Unregistered  Math  11  20041130 22:53 