![]() |
|
|
#1 |
|
22×32×72 Posts |
hi all,
I found this program yesterday and i was thinking about how to tell how many digits are in a 2^n number if i knew n. I made a Microsoft Excel spreadsheet and calculated out about 40 sequences, and eventually found a pattern relating the n's that end in 0 (multiples of 10). my pattern was ((3/10)*n) + 1. for example, using 0 for n, the result (number of digits in 2^n) is 1, as it should be. using 10, 20, 30, and 40 for n, i get 4, 7, 10, 13 respectively. i checked the actual digits by doing the math on the calculator and counting digits, and the pattern works. i found this page http://www.utm.edu/research/primes/mersenne/index.html which showed a table of known mersenne primes. i tested my equation on the table, and got good results until n=1279. according to the chart, 2^n should have 386 digits. however, when i plugged it into my equation, i came up with 384 digits. each n after that also gave incorrect answers, and they get continually worse. for example, the 40th mersenne prime, 2^20996011 -1 has 6,320,430 digits according to the chart, but only 6,298,804 digits according to my equation (i used n=20996010 to get the answer, because i found a pattern that shows that after a multiple of 10, the next 3 have the same amount of digits, followed by 3 with 1 more digit, another 3 with 2 more digits, and then the next multiple of 10 is reached). So, i was wondering how you guys got the number of digits in a 2^n number, and why my equation and the "known" digits are so far off. thanks in advance, michael p.s. if you don't understand what i wrote, say so and i'll try to clarify. |
|
|
|
#2 |
|
Jun 2004
UK
139 Posts |
floor(log 2 * n) + 1
Where log is base 10. |
|
|
|
|
|
#3 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2×53×71 Posts |
There are ceiling (n * log10(2)) digits. The base 10 log of 2 is .30103
|
|
|
|
|
|
#4 |
|
27·3·17 Posts |
ah, that makes sense. now i see why mine are so close at the beginning and then so far off later on.
but then, another quick question--what do floor and ceiling mean? |
|
|
|
#5 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2×53×71 Posts |
floor is round down. ceiling is round up.
|
|
|
|
|
|
#6 |
|
1C516 Posts |
ah, got it. thanks
|
|
|
|
#7 |
|
Sep 2002
2·3·7·19 Posts |
Are floor and ceiling terms simply the same thing as the boundaries of the logarithmic functions?
|
|
|
|
|
|
#8 |
|
Jun 2004
UK
8B16 Posts |
They're just "functions".
floor refers to the integer that is closest to a number without being higher. ceiling refers to the integer that is closest to a number without being lower. They're just fancy names for rounding up and rounding down. |
|
|
|
|
|
#9 |
|
Oct 2003
Australia, Brisbane
2×5×47 Posts |
I don't know about other languages.. but I know that I use floor and ceiling a lot in both excel and matlab. Both floor and ceiling are acual "functions" in both programs. However, I haven't actually ever seen floor or ceiling written in any maths textbooks as far as I can remember... I could be wrong though.
|
|
|
|
|
|
#10 | |
|
Bamboozled!
"πΊππ·π·π"
May 2003
Down not across
29×3×7 Posts |
Quote:
floor(x) is represented by |_ x _| and ceiling(x) has the horizontal lines at the top. Paul |
|
|
|
|
|
|
#11 |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
22·3·641 Posts |
See
http://mathworld.wolfram.com/FloorFunction.html and http://mathworld.wolfram.com/CeilingFunction.html for clear examples and fuller explanation. |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| who can help me factor this 155 digits number | sinide | Factoring | 12 | 2010-11-09 01:05 |
| who can factor this 128 digits number? | aaa120 | Factoring | 19 | 2010-09-04 09:16 |
| Number Of Digits; I Hate To Ask | storm5510 | Other Mathematical Topics | 14 | 2010-08-31 01:16 |
| Factoring 132-digits Number | abc_temp | Factoring | 14 | 2007-12-23 20:25 |
| Number of digits display | grobie | 15k Search | 13 | 2005-09-29 21:57 |