Message Boards Message Boards

0
|
11508 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

I want to perform simple math on very large numbers, how?

Posted 10 years ago
I have been using WolframAlpha for verifying some output I get from some arbitrary precision work I have been doing.  Now I want to use larger number but they cannot fit in the query box.  It said I should use the data input to insert more data.  How would I go about doing this, assuming this is possible?  I already have WolframAlpha pro and none of the examples show how to do this.  I thought I could upload Mathematica code but either I don't know hot to do basic Mathematica or I was wrong on my assumption.

Can anyone point me in the right direction?

Thanks.
POSTED BY: Jeffrey Robinson
6 Replies
For some reason it won't let me reply to specific people.

I think I was a little hasty on my examples and gave the wrong impression.  The numbers can be any numbers that are that long or even longer.  I can't use any formulas to generate the numbers (probably in 99.999..% of the cases).

@Peter Fleck
I don't understand what you are trying to explain.  

@Chip Hurst
See explanation above.

@Bill Simpson
See explanation above.

I am getting a feeling that it might not just be possible.
POSTED BY: Jeffrey Robinson
Posted 10 years ago
9999999999999999999999999999999999999999999999999999999999999999999==10^67 - 1
999999999999999999999999999999999999999999999999999999999999999==10^63-1
111111111111111111111111111111111111111111111111111111111111111==(10^64 - 1)/9)
and WolframAlpha is happy to then do this
http://www.wolframalpha.com/input/?i=%2810%5E67+-+1%29*%2810%5E63+-+1%29+mod+%28%2810%5E64+-+1%29%2F9%29
POSTED BY: Bill Simpson
Posted 10 years ago
Could you give a more specific example of what you're trying to accomplish?
POSTED BY: Greg Hurst
Sorry for the late reply, was out of town at a conference.

I want to compute something like this, but sometimes larger:

(9999999999999999999999999999999999999999999999999999999999999999999*999999999999999999999999999999999999999999999999999999999999999) mod 1111111111111111111111111111111111111111111111111111111111111111

but it says that the "input is too long" and that I need to use "Data input" first.  But when I use data input I have no clue how to use it and the examples don't do anything like what I want to do.  It just seems to be for tabular data.
POSTED BY: Jeffrey Robinson
Posted 10 years ago
Wolfram|Alpha accepts English language input, not necessarily all types of mathematical expressions.

Mathematica using Wolfram Language, whose capabilities you are implicitly accessing via Wolfram|Alpha, is probably the most efficient tool for your work with arbitary precision numbers, see e.g.

http://reference.wolfram.com/mathematica/tutorial/ArbitraryPrecisionNumbers.html

thereby also avoiding any ambiguities natural languages have and limitations Wolfram|Alpha needs to impose.

Evaluating your example:
In[2]:= Mod[
  9999999999999999999999999999999999999999999999999999999999999999999*\
999999999999999999999999999999999999999999999999999999999999999,
  1111111111111111111111111111111111111111111111111111111111111111] \
// Timing

Out[2]= {0.000038, \
111111111111111111111111111111111111111111111111111111111110212}
POSTED BY: Peter Fleck
Posted 10 years ago
While this won't work for most large inputs, we can actually get a result in alpha for the above input by writing it as
"Sum[9*10^i, {i, 0, 66}]*Sum[9*10^i, {i, 0, 62}] mod Sum[10^i, {i, 0, 63}]"
http://www.wolframalpha.com/input/?i=Sum%5B9*10%5Ei%2C+%7Bi%2C+0%2C+66%7D%5D*Sum%5B9*10%5Ei%2C+%7Bi%2C+0%2C+62%7D%5D+mod+Sum%5B10%5Ei%2C+%7Bi%2C+0%2C+63%7D%5D
POSTED BY: Greg Hurst
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract