Group Abstract Group Abstract

Message Boards Message Boards

0
|
779 Views
|
23 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Overflow calculating the last 10, 000 digits of (((96717311574016^16777216^4)^8^4)^7)^2

Posted 1 month ago

why is 96717311574016^8^16 the biggest number it can compute and any number larger than that overflows?
I was discussing the first 4000 digits of my expression (((96717311574016^16777216^4)^8^4)^7)^2 * 7^11. Because this expression is greater than 96717311574016^8^16 and it is going to overflow, can someone help me how to calculate the LAST ten thousand, or even MILLION digits of this expression. Do I calculate the mod of this expression?
Can I even calculate the mod if its just going to overflow?

POSTED BY: Mark Raygorodsky
23 Replies

syntax error: Log10 [96717311574016] * can't be followed by [16777216^7 * 8^2].

POSTED BY: Mark Raygorodsky

is there a way to find out what the first 50, 000 digits of GRAHAM'S NUMBER are?

POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Hans Milton
POSTED BY: Paul Abbott

I am going to set the mantissa of this code to a MILLION digits. It’s basically 5, followed by a decimal point, followed by a million digits after that. Every method I tried to compute the first million digits of my number results in an overflow error. I don’t get the same error when computing the last million digits. To me the first and last million digits is the same size of the number and they both shouldn’t overflow. That “100” you wrote in your code should be at least 50, 000. I copied and pasted your code into my notebook and set the number to 10, 000. And I get an error “precision depth exceeded.”

POSTED BY: Mark Raygorodsky
POSTED BY: Mark Raygorodsky

For the last digits I use the mod function, but still haven't figured out how to calculate the FIRST digits! a log of a number shows how long the number is. Does it also calculate the first digits?!

POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Bill Nelson

I haven't found a way to get the first digits of my number and it's so EXTREMELY HARD that I must as well forget about them and focus on the last digits. I typed my expression in and it gave me something mod^2 power, 1977326743 followed by a million zeros and these ARE NOT THE LAST MILLION DECIMAL DIGITS I AM EXPECTING!

POSTED BY: Mark Raygorodsky
Posted 1 month ago

I have not been able to think of a way to exactly calculate the leading digits of your huge number without overflow. But I did think of a risky and potentially error prone way that might approximate this. There is an algorithm to quickly calculate arbitrary powers using recursive squaring. Google can help you find that algorithm and an explanation of how it works. Then imagine at each step of this process we throw away any power of ten that has appeared. The mathematica function MantissaExponent can be used to do that. All this tries to keep the calculated value small enough that the calculation does not overflow and fail.

power[base_,exponent_]:=
  If[exponent==0,1,
    If[EvenQ[exponent],temp=power[base,exponent/2];MantissaExponent[temp*temp][[1]],
      temp=power[base,(exponent-1)/2];MantissaExponent[base*temp*temp][[1]]
    ]
  ];
MantissaExponent[power[N[96717311574016,100],16777216^4*8^4*7*2]*7^11][[1]]

which returns

0.519477805513753546135142414870187736952679394740473429808918564205

Ignore the leading "0.", it is the digits that follow this that you want to concentrate on. That claims that your huge number probably begins with the digits 519477...

The ",100" in that tells Mathematica you want to try to use 100 digit floating point precision in every step. If you change that to ",200" then it will try to use 200 digits. But before you change this to 200 or 10,000 or 1,000,000 or more, study this and the Google search result explaining the process and then try this on much much smaller, but gradually increasing in size, numbers. Do this with small enough numbers that you can use Mathematica to calculate the exact value and repeat the calculation with this approximate method and see how many of the digits from the two methods agree. I am certain that if you try this on enough examples and the size of the exact result is close to or beyond the number of floating point digits that you ask it to use that you will find examples where some of the the last digits in the result will be incorrect. I am hoping this will let you see some of the leading digits and that enough of those will be correct that you can use them. Be very very careful with this. If anyone finds any mistake in this then please point it out to me. Thank you

POSTED BY: Bill Nelson

I calculate the last digits by using mod 10^50000 something. How do I calculate the FIRST 50, 000 digits of my expression (96717311574016^16777216^4)^8^4)^7)^2 * 7^11

POSTED BY: Mark Raygorodsky
Posted 1 month ago

It seems to me that you should try contacting Wolfram customer support and see if they can help you get this fixed.

POSTED BY: Bill Nelson
POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Bill Nelson
POSTED BY: Mark Raygorodsky

the notebook five minutes.nb is in my notes but i cant open it; clicking it just duplicates it in my notes

POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Bill Nelson

I now have it on my computer but I am still clueless how to use the language.

POSTED BY: Mark Raygorodsky

it gives me syntax error: ( can't be followed by mod (power mod(96717311574016, 16777216^4 * 8^4 * 7 * 2, 10^(10^6)) * 7^11, 10^(10^6))

POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Hans Milton
Posted 1 month ago

Changing from 10 thousand digits to 1 million digits required changing 10^(10^4) to 10^(10^6) in two places. The output is then large enough that MMA doesn't immediately show you all of the result on the screen so adding //InputForm may overcome that. That may pop up a little window asking you if you really want an output that large. If so then you confirm you want that.

Try

Mod[PowerMod[96717311574016,16777216^4*8^4*7*2,10^(10^6)]*7^11,10^(10^6)]//InputForm

and see if that works for you.

POSTED BY: Bill Nelson

thanks so much bill! so now my question is how to I calculate the last MILLION digits of my expression (((96717311574016^16777216^4)^8^4)^7)^2 * 7^11? I am basically asking to calculate mod 10^1, 000, 000 of 96717311574016^(16777216^4 * 8^4 * 7 * 2) * 7^11. but first I need to know how to use Mathematica on my computer.

POSTED BY: Mark Raygorodsky
Posted 1 month ago
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard