# Is dealing with large numbers as formula a thing? and how is it done?

• I
• AtlasSniperma
In summary, the conversation discusses the possibility of extracting a specific digit from a large number stored in a formulaic form, such as in the case of the number 2^(82589933) - 1. The method of using modular arithmetic for finding the last digits is suggested, as well as using approximations for the first digits. The conversation also mentions the use of SQL string functions for this purpose, and asks for any advice on the topic.
AtlasSniperma
TL;DR Summary
Arithmetic using numbers in equation form?
Hi everyone.
I haven't been here in years, I'm surprised the account still works.

Anyway. I have a mathematic thought/question that I really want to learn about. I realize this isn't going to be the easiest thing to explain if it is even possible, so please forgive me.

So, What I want to do is be able to extract a specific digit from a number when that number is stored in some formulaic form.

An easy example: 111^2, digit 1(leftmost, 10,000s column, whatever) = 1. digit 3 = 3, digit 4 = 2 etc.

A more understandable example is the number 2^(82589933) - 1 which is one of the largest known primes.
My computer will never be able to process that number as a standard number, so I'd love to be able to do arithmetic on it while it's in this more easily maneuvered form.

ultimately, in this case, I'd love to be able to incorporate this methodology into an iterative function that prints the number one digit at a time so as to not attempt to choke on it's sizeable girth.

I do remember hearing about something like this being used with Pi, but I do realize that's not necessarily related to the field I'm asking about.I hope that makes sense. Thanks for any advice anyone can give.

Actually 2^(82589933) - 1 isn't all that big. It will fit in about 10 Megabytes. Adding 2 numbers of that size will be about a millisecond. Multiplying two numbers of that size would take a computer about an hour using the elementary school method, that uses a number of operations that is proportional to the square of the input size, but can still be done in under a second by using a fast Fourier transform method.

There is no single general method that will always work.

What often works for the last digits is modular arithmetic. If you just care about the last digit, only calculate the remainder when divided by 10, if you are interested in the last two take the remainder mod 100 and so on. As an example for powers of 2 (subtracting 1 is trivial):
20 = 1
21 = 2
22 = 4
23 = 8 = 8 (mod 10)
24 = 16 = 6 (mod 10)
25 = 32 = 2 (mod 10)
26 = 64 = 4 (mod 10)
from here on it is always the cycle 2,4,8,6, ... That means we can subtract a multiple of 4 from the exponent without changing the last digit.

282589933 = 282589932+1 = 21 = 2 mod 10
Therefore 282589933-1 ends in a 1.

I didn't use a calculator anywhere. With a bit more work you can get the next to last digit as well, and a computer will quickly produce the last 10 digits that way.

Approximations can work for the first digits. ##\log(2^{82589933}) = 82589933 \log(2) \approx 24862047.17288##. Therefore ##2^{82589933} \approx 10^{24862047+0.17288} = 10^{0.17288} \cdot 10^{24862047} = 1.4889 \cdot 10^{24862047}##. And indeed, the prime starts with 14889 and has 24862048 decimal digits.

I wonder if you can use some SQL string function for this. Maybe @sqljunkey knows?

## 1. What is meant by "dealing with large numbers as formula"?

Dealing with large numbers as formula refers to using mathematical equations or formulas to manipulate and analyze numbers that are significantly larger than the average numbers we encounter in our daily lives. This can involve operations such as addition, subtraction, multiplication, and division.

## 2. Why is it important to be able to deal with large numbers as formula?

Being able to deal with large numbers as formula is important in many fields, such as science, engineering, finance, and economics. It allows us to accurately represent and analyze data, make predictions, and solve complex problems that involve large numbers.

## 3. How is dealing with large numbers as formula different from dealing with smaller numbers?

Dealing with large numbers as formula is different from dealing with smaller numbers because it requires a different approach and set of tools. For example, when dealing with large numbers, we may need to use scientific notation, logarithms, or other mathematical techniques to simplify and work with the numbers effectively.

## 4. What are some common challenges when dealing with large numbers as formula?

Some common challenges when dealing with large numbers as formula include computational errors, difficulty visualizing and understanding the magnitude of the numbers, and the complexity of the calculations involved. It is important to have a good understanding of mathematical principles and techniques to overcome these challenges.

## 5. How can one improve their ability to deal with large numbers as formula?

To improve your ability to deal with large numbers as formula, it is important to practice and familiarize yourself with mathematical concepts and techniques such as scientific notation, logarithms, and rounding. It can also be helpful to use calculators or computer software when working with very large numbers to minimize the risk of errors.

Replies
14
Views
1K
Replies
1
Views
2K
Replies
4
Views
1K
Replies
3
Views
1K
Replies
7
Views
2K
Replies
4
Views
1K
Replies
1
Views
2K
Replies
3
Views
2K
Replies
3
Views
2K
Replies
3
Views
1K