mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2012-02-06, 23:26   #1
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

10010101112 Posts
Question How to convert 5495-bit binary number to decimal?

Can someone tell me how to convert this number to decimal? I can't find a program that can convert it. Why can't I paste the whole number into Yafu? It keeps cutting off the last 1401 bits and when I try to type them in manually, it won't let me. Why?
Code:
100000000101110100110100010010101011010001101000101000001101010011010001010100101101000011010001010010101101001001110100101001001011101010001110101010010010101110101010011010001010001010110100000110100100000101011010001001110100101000010101110100100011101001010100001011101001010011010000100001110101000011101010000100100111010001010101101010010101101000001101010100101101001001000110100000000110100000011101010010101010111010000100111010010101010101010111010000101010111010000101000101110100010100110100100001010011010010100100110100100010110101000101110100100101011101001010001110101001010010011101010101000011010010101010111010100100010110101000010110101000100110101010101000101101001010100100101101010010010111010101001010111010100101001101010100001110100010010010101110101010010101110101010000011101010010000011010101010010111010100101011010001001000111010000000111010010100101010101110100101001001010111010000010101110100001000111010000010101001110100001010011101000001000101110100010000111010000100101001110100010000101101000101001011101000101001011010010000010110100010101001001101000101010101110100100000111010010010101010111010101010011010010001010110100100100101101000000010110100000100011010000010010110100000000011010010100010111010010101000110100101001010110100000100111010010101001011010010011101010000001010111010100000011010101000101010110100101010110101000010101110101001001010111010100010010110101001000010111010000001110101001000101101010010100110101010001011101010010100101110101010000010111010101000001011101000000111010101000010101110100101010110101010000101110101000101010111010101001001011101010101000011101010000000111010010010000110100100100010110101010101001110100000000101101001000011010101010100101110100100001101001000101010111010000100011101000100001110100001101000000010110100000100101110101010010101011010001000100101110100000100111010101001101000001010101101000010000111010010000100011101010101010100111010000100100111010001001000011101000010100101101000010100001110101010101010111010001001001101000100100110101001010010111010001000101011101000000011101000100100101110100110100100100001011010101010011010001010001011101000011010100001000101101010011010101001010010110101010011010010010101110100110100100000101101000101010100011101001000010101101000000100110100100010010111010010000110101000001001011101001001010011010010010101011010011010010010100101101001101001010000010110100100000111010100100110101010100001011101001010000101110100101010101110101000100101101001001110100101010001011101000100111010100001011010010011101001010101010111010010001110100101010100101110100100011101010000010101011100110101000001011010010011101010000001011101001011010100000101011010010100101110101000010010111010000110101000100001011010100110101000100010110101010100101110101000101001011010001010101011101001000010101101010001011101010010010101011101010100100101110101000111010100011101010010010010111010100011101010010100010111010100010111010100001001011101010001110100010100010111010010100101110101001010100101110100101010101010110101000010101010110100001001110100001010101010111010101000101011101010100010101110100000011101010100010010111010000001110101010010001011101010000001101010000101101000000111010010000001011101010001110101001000101011101010011010101010001010110100000110101010100101010110100000010011010101010010011101010011010101010010010110101001101001001001110100000110101010101001010110101000100110100010100101010111010000011010101010101001011010001000111010001010101010101101000100011101000010101110100010010000111010011010000000100111010000001001011101000100010100111010000001001011101001010101010010110100001010101011101000100101001011101000001000101110101010010110100010001001110100000100101011101000000101010110100001000111001111010000100000111010000100100111010000010100101110100000101001011010000100010101110100001000100110100010000111010111101000010010010111010000100100101110100000001010111010000101010001101000100101110100001000001110100001001110100010000010111010101001011010001000001011101000010101010111010000001010101110100010000101011101000100001010111010010000011101010010010011010000001010111010001000100101110101010000111010100101011010010101010000110100000101001101000000011101000001001001110100101101001000101001011010101001101000101001001011010101001101000101010001011001101010010010111010101001101000101010101011001101010001010101100110100100010101010111010001000111010010010101010101101001010010100011010010000001011101000001101010100101010101101001010101101001000100010111010001010101101010000010101101000100000110100100010101101000010011101010010101010101110100101101001001000101011001101001001001010101110100110100100100101011010010110100100100100101101001011010010010100010110011010010010100101011101000101011101001001011100110100100101010010111001101001010001010101110100010001110100001010010110100101000101110100101000101011010001001110100101000100101110100010011101001010010001011100110100100010001110100010011101001010010101011100110100101000001110011010101010101101000000011101001010100101010111010010001110100101010010101110011010000101001001100110101000001101000000011101001010101001010111001101010001000011010000000111010001001010101011101000100011101010101010101010110100001001110100100010010101110100101010001001101010000000101101001001110101000010101110100100001101010000000101101001000111010100100101110100001101010000101010110101000101110101000010100101110101000101110101000101010101110011010100010101101000011010100010010100
Stargate38 is offline   Reply With Quote
Old 2012-02-06, 23:39   #2
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

55816 Posts
Default

In python:

Code:
def conv(x):
    ret=0;p=1
    while x>0:
        ret+=p*(x%10);x//=10;p*=2
    return ret
R. Gerbicz is offline   Reply With Quote
Old 2012-02-06, 23:44   #3
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by Stargate38 View Post
Can someone tell me how to convert this number to decimal? I can't find a program that can convert it. Why can't I paste the whole number into Yafu? It keeps cutting off the last 1401 bits and when I try to type them in manually, it won't let me. Why?
Code:
100000000101110100110100010010101011010001101000101000001101010011010001010100101101000011010001010010101101001001110100101001001011101010001110101010010010101110101010011010001010001010110100000110100100000101011010001001110100101000010101110100100011101001010100001011101001010011010000100001110101000011101010000100100111010001010101101010010101101000001101010100101101001001000110100000000110100000011101010010101010111010000100111010010101010101010111010000101010111010000101000101110100010100110100100001010011010010100100110100100010110101000101110100100101011101001010001110101001010010011101010101000011010010101010111010100100010110101000010110101000100110101010101000101101001010100100101101010010010111010101001010111010100101001101010100001110100010010010101110101010010101110101010000011101010010000011010101010010111010100101011010001001000111010000000111010010100101010101110100101001001010111010000010101110100001000111010000010101001110100001010011101000001000101110100010000111010000100101001110100010000101101000101001011101000101001011010010000010110100010101001001101000101010101110100100000111010010010101010111010101010011010010001010110100100100101101000000010110100000100011010000010010110100000000011010010100010111010010101000110100101001010110100000100111010010101001011010010011101010000001010111010100000011010101000101010110100101010110101000010101110101001001010111010100010010110101001000010111010000001110101001000101101010010100110101010001011101010010100101110101010000010111010101000001011101000000111010101000010101110100101010110101010000101110101000101010111010101001001011101010101000011101010000000111010010010000110100100100010110101010101001110100000000101101001000011010101010100101110100100001101001000101010111010000100011101000100001110100001101000000010110100000100101110101010010101011010001000100101110100000100111010101001101000001010101101000010000111010010000100011101010101010100111010000100100111010001001000011101000010100101101000010100001110101010101010111010001001001101000100100110101001010010111010001000101011101000000011101000100100101110100110100100100001011010101010011010001010001011101000011010100001000101101010011010101001010010110101010011010010010101110100110100100000101101000101010100011101001000010101101000000100110100100010010111010010000110101000001001011101001001010011010010010101011010011010010010100101101001101001010000010110100100000111010100100110101010100001011101001010000101110100101010101110101000100101101001001110100101010001011101000100111010100001011010010011101001010101010111010010001110100101010100101110100100011101010000010101011100110101000001011010010011101010000001011101001011010100000101011010010100101110101000010010111010000110101000100001011010100110101000100010110101010100101110101000101001011010001010101011101001000010101101010001011101010010010101011101010100100101110101000111010100011101010010010010111010100011101010010100010111010100010111010100001001011101010001110100010100010111010010100101110101001010100101110100101010101010110101000010101010110100001001110100001010101010111010101000101011101010100010101110100000011101010100010010111010000001110101010010001011101010000001101010000101101000000111010010000001011101010001110101001000101011101010011010101010001010110100000110101010100101010110100000010011010101010010011101010011010101010010010110101001101001001001110100000110101010101001010110101000100110100010100101010111010000011010101010101001011010001000111010001010101010101101000100011101000010101110100010010000111010011010000000100111010000001001011101000100010100111010000001001011101001010101010010110100001010101011101000100101001011101000001000101110101010010110100010001001110100000100101011101000000101010110100001000111001111010000100000111010000100100111010000010100101110100000101001011010000100010101110100001000100110100010000111010111101000010010010111010000100100101110100000001010111010000101010001101000100101110100001000001110100001001110100010000010111010101001011010001000001011101000010101010111010000001010101110100010000101011101000100001010111010010000011101010010010011010000001010111010001000100101110101010000111010100101011010010101010000110100000101001101000000011101000001001001110100101101001000101001011010101001101000101001001011010101001101000101010001011001101010010010111010101001101000101010101011001101010001010101100110100100010101010111010001000111010010010101010101101001010010100011010010000001011101000001101010100101010101101001010101101001000100010111010001010101101010000010101101000100000110100100010101101000010011101010010101010101110100101101001001000101011001101001001001010101110100110100100100101011010010110100100100100101101001011010010010100010110011010010010100101011101000101011101001001011100110100100101010010111001101001010001010101110100010001110100001010010110100101000101110100101000101011010001001110100101000100101110100010011101001010010001011100110100100010001110100010011101001010010101011100110100101000001110011010101010101101000000011101001010100101010111010010001110100101010010101110011010000101001001100110101000001101000000011101001010101001010111001101010001000011010000000111010001001010101011101000100011101010101010101010110100001001110100100010010101110100101010001001101010000000101101001001110101000010101110100100001101010000000101101001000111010100100101110100001101010000101010110101000101110101000010100101110101000101110101000101010101110011010100010101101000011010100010010100
my base conversion script in pari gave me back:

Code:
14489710670678635154396790079231422475904721345113119262216289593213010118808482180620967227264718731288886916764453766557535253112289385628235430035685103415108171315379506692713884956977194093869451479977164567655590589366921042122339671891877583771092652881851051011641111978903781433074829792066193506040863107250069969059664641303166095328284261417638659434468302113960525469372859843676344314666965646146907426842950119480690368744719186181280048642154684357702985521595195268830246159172792708984538318959309229422691400290096334675124345146929045462108965961569930253977577929139521813268408955978043828875865660038987141927843407809666541765192402603547454405437251839828856550874844702711350268168444599778748821068610942088737391752810356256038875061627741279885545646312850578475029130887798105561586482289652284714572386236665221312245511063620415022170675267612062164723350091271704328429739084694374852875088857580124971654182480844153077508528908266903497132583148599819005246019467476275448324345495447220413573708005787132171393645240283964972433978052182618805971412003486013401737935180689468348255748511624030987327877993811635477183308110713408185642664443262821957421629199573391994090193636838125988873120302909809761844168960069644984154608060863768597987862705337646993242038943238214029239370463856949640689917954191071222140551634974666545933579975969465681963815297025452620034803335747269552117144900739288697959840689799949113248058749753376795028089033314155001210277679833376281450910893304441014485247847584230506363250250726101863457262844008129142610551604615330366703991378279496275009852859210020027303960373891278996

Last fiddled with by science_man_88 on 2012-02-06 at 23:45
science_man_88 is offline   Reply With Quote
Old 2012-02-06, 23:54   #4
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

23·32·19 Posts
Default

Interesting, here python 3.1 also cuts the number at 4092 bits. That is close to 2^12 bits.

Last fiddled with by R. Gerbicz on 2012-02-06 at 23:58
R. Gerbicz is offline   Reply With Quote
Old 2012-02-06, 23:58   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
Interesting, here python 3.1 also cuts the number at 4091 bits. That is close to 2^12 bits.
yeah just checked what I did my conversion on it had 4885 bits suposedly so it's not a proper conversion result. edit: just did it without a select all command checked the length it's actually one longer than is said now. I got:

Quote:
"1448971067067863515439679007923142247590472134511311926221628959321301011880848218062096722726471873128888691676445376655753525311228938562823
543003568510341510817131537950669271388495697719409386945147997716456765559058936692104212233967189187758377109265288185105101164111197890378143307482
979206619350604086310725006996905966464130316609532828426141763865943446830211396052546937285984367634431466696564614690742684295011948069036874471918
618128004864215468435770298552159519526883024615917279270898453831895930922942269140029009633467512434514692904546210896596156993025397757792913952181
326840895597804382887586566003898714192784340780966654176519240260354745440543725183982885655087484470271135026816844459977874882106861094208873739175
281035625603887506162774127988554564631285057847502913088779810556158648228965228471457238623666522131224551106362041502217067526761206216472335009127
170432842973908469437485287508885758012497165418248084415307750852890826690349713258314859981900524601946747627544832434549544722041357370800578713217
139364524028396497243397805218261880597141200348601340173793518068946834825574851162403098732787799381163547718330811071340818564266444326282195742162
919957339199409019363683812598887312030290980976184416896006964498415460806086376859798786270533764699324203894323821402923937046385694964068991795419
107122214055163497466654593357997596946568196381529702545262003480333574726955211714490073928869795984068979994911324805874975337679502808903331415500
121027767983337628145091089330444101448524784758423050636325025072610186345726284400812914261055160461533036670399137827949627500985285921002002730396
0373891278996"

Last fiddled with by science_man_88 on 2012-02-07 at 00:18
science_man_88 is offline   Reply With Quote
Old 2012-02-07, 00:03   #6
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

29×313 Posts
Default

BUFSIZ is probably 4096 on most systems.

Paste in tcsh in SuSE only agrees to paste 4096 symbols; it is a good thing that some other limits in modern linux are not 4096 (e.g. command-line length limit; on SGI IRIX it was ridiculously small)
Batalov is offline   Reply With Quote
Old 2012-02-07, 00:07   #7
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

B1616 Posts
Default

This link/tool can handle such long numbers, too.
kar_bon is offline   Reply With Quote
Old 2012-02-07, 02:14   #8
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

5·11·157 Posts
Default

You can copy and paste it in excel and use MID/CHOOSE functions to get the hex of it (direct convert them 4 by 4 into the hex digit, one line function), you get something like 805D344AB46.... which is 1374 digits long and that can be feed to yafu, pari/gp, or the tool linked by karbon (which has a 2000 digits limitation, too, it can't handle the binary part). It took me a minute and I got same result as sm88 above.
LaurV is offline   Reply With Quote
Old 2012-02-07, 06:04   #9
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2·3·11·43 Posts
Default

Quote:
Originally Posted by LaurV View Post
[...] or the tool linked by karbon (which has a 2000 digits limitation, too, it can't handle the binary part).
That's not correct.

I've input the binary and got the same result as in post #5.
kar_bon is offline   Reply With Quote
Old 2012-02-07, 06:23   #10
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

21BB16 Posts
Default

Strange... This I get if I paste directly:
Code:
ERROR

 The requested URL could not be retrieved

   While trying to retrieve the URL: http://wims.unice.fr/wims/wims.cgi?session=Q19BCBC2B4.1&lang=en&cmd=reply&module=tool%2Fnumber%2Fbaseconv.en&input=100000000101110100110100010010101011010001... <etc, cut by LaurV> 
 The following error was encountered: 
  • Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:
  • Missing or incorrect access protocol (should be `http://'' or similar)
  • Missing hostname
  • Illegal double-escape in the URL-Path
  • Illegal character in hostname; underscores are not allowed
Which does not happen when I paste the hex stuff. Could be my firefox/xp/firewall at job?? I will try again when I reach home tonight, just from curiosity.
LaurV is offline   Reply With Quote
Old 2012-02-07, 10:33   #11
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

287710 Posts
Default

Your number is 5496 binary digits. Here is the number I get with GMP. It's 1655 digits long which sounds right since 25495 = 1.44*101654:

Code:
14489710670678635154396790079231422475904721345113119262216289593213010118808482180620967227264718731288886916764453766557535253112289385628235430035685103415108171315379506692713884956977194093869451479977164567655590589366921042122339671891877583771092652881851051011641111978903781433074829792066193506040863107250069969059664641303166095328284261417638659434468302113960525469372859843676344314666965646146907426842950119480690368744719186181280048642154684357702985521595195268830246159172792708984538318959309229422691400290096334675124345146929045462108965961569930253977577929139521813268408955978043828875865660038987141927843407809666541765192402603547454405437251839828856550874844702711350268168444599778748821068610942088737391752810356256038875061627741279885545646312850578475029130887798105561586482289652284714572386236665221312245511063620415022170675267612062164723350091271704328429739084694374852875088857580124971654182480844153077508528908266903497132583148599819005246019467476275448324345495447220413573708005787132171393645240283964972433978052182618805971412003486013401737935180689468348255748511624030987327877993811635477183308110713408185642664443262821957421629199573391994090193636838125988873120302909809761844168960069644984154608060863768597987862705337646993242038943238214029239370463856949640689917954191071222140551634974666545933579975969465681963815297025452620034803335747269552117144900739288697959840689799949113248058749753376795028089033314155001210277679833376281450910893304441014485247847584230506363250250726101863457262844008129142610551604615330366703991378279496275009852859210020027303960373891278996

Last fiddled with by ATH on 2012-02-07 at 10:34
ATH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
very long binary representation to decimal davar55 Programming 24 2014-12-07 00:19
Convert Binary to BCD code tinhnho Miscellaneous Math 8 2005-09-18 15:14
Binary representation prime number of 1's. TTn 15k Search 0 2004-12-18 21:10
decimal-binary prime pairs ixfd64 Math 2 2003-10-16 13:40
Converting big numbers to and from binary and decimal Quantum Skyline Math 5 2002-12-27 19:23

All times are UTC. The time now is 03:20.

Tue Aug 4 03:20:53 UTC 2020 up 17 days, 23:07, 0 users, load averages: 1.82, 1.53, 1.52

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